first of many performance improvements: no unnecessary TextSVG re-renders - more to follow
This commit is contained in:
parent
af60e811fc
commit
0fc3775a11
14 changed files with 116 additions and 74 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import { memo } from "react";
|
||||
import { Vec2D } from "./geometry";
|
||||
import { HISTORY_RADIUS } from "./parameters";
|
||||
|
||||
export function HistorySVG(props: {uid: string, topLeft: Vec2D, kind: "shallow"|"deep", selected: boolean, highlight: boolean}) {
|
||||
export const HistorySVG = memo(function HistorySVG(props: {uid: string, topLeft: Vec2D, kind: "shallow"|"deep", selected: boolean, highlight: boolean}) {
|
||||
const text = props.kind === "shallow" ? "H" : "H*";
|
||||
return <>
|
||||
<circle
|
||||
|
|
@ -38,4 +39,4 @@ export function HistorySVG(props: {uid: string, topLeft: Vec2D, kind: "shallow"|
|
|||
data-parts="history"
|
||||
/>}
|
||||
</>;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue