mirror of
https://github.com/markmanx/isoflow.git
synced 2025-02-08 12:27:53 +00:00
feat: performance upgrade (solves issue with nodes not being GC'd)
This commit is contained in:
parent
2a9d10bf9b
commit
bf42411d5e
6 changed files with 15 additions and 15 deletions
|
@ -31,7 +31,9 @@ export const Grid = () => {
|
|||
sx={{
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
height: '100%'
|
||||
}}
|
||||
style={{
|
||||
background: `repeat url("${gridTileSvg}")`,
|
||||
backgroundSize: `${projectedTileSize.width}px`,
|
||||
backgroundPosition: `calc(50% + ${
|
||||
|
|
|
@ -30,18 +30,20 @@ export const ConnectorLabel = ({ connector }: Props) => {
|
|||
<Box
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
left: labelPosition.x,
|
||||
top: labelPosition.y,
|
||||
transform: `translate(-50%, -50%) scale(${zoom})`,
|
||||
pointerEvents: 'none',
|
||||
bgcolor: 'common.white',
|
||||
border: 1,
|
||||
py: 0.5,
|
||||
px: 1,
|
||||
borderRadius: 1,
|
||||
maxWidth: projectedTileSize.width * (1 / zoom),
|
||||
borderColor: 'grey.200'
|
||||
}}
|
||||
style={{
|
||||
transform: `translate(-50%, -50%) scale(${zoom})`,
|
||||
maxWidth: projectedTileSize.width * (1 / zoom),
|
||||
left: labelPosition.x,
|
||||
top: labelPosition.y
|
||||
}}
|
||||
>
|
||||
<Typography color="text.secondary" variant="body2">
|
||||
{connector.label}
|
||||
|
|
|
@ -85,7 +85,7 @@ export const Connector = ({ connector }: Props) => {
|
|||
}, [connector.style, connectorWidthPx]);
|
||||
|
||||
return (
|
||||
<Box sx={css}>
|
||||
<Box style={css}>
|
||||
<Svg
|
||||
style={{
|
||||
// TODO: The original x coordinates of each tile seems to be calculated wrongly.
|
||||
|
|
|
@ -34,13 +34,13 @@ export const Node = ({ node, order }: Props) => {
|
|||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
style={{
|
||||
position: 'absolute',
|
||||
zIndex: order
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
style={{
|
||||
position: 'absolute',
|
||||
left: position.x,
|
||||
top: position.y
|
||||
|
@ -53,7 +53,7 @@ export const Node = ({ node, order }: Props) => {
|
|||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: -projectedTileSize.height
|
||||
}}
|
||||
|
|
|
@ -11,11 +11,7 @@ export const Nodes = () => {
|
|||
<>
|
||||
{nodes.map((node) => {
|
||||
return (
|
||||
<Node
|
||||
key={node.id}
|
||||
order={-node.tile.x - node.tile.y}
|
||||
node={node}
|
||||
/>
|
||||
<Node key={node.id} order={-node.tile.x - node.tile.y} node={node} />
|
||||
);
|
||||
})}
|
||||
</>
|
||||
|
|
|
@ -26,7 +26,7 @@ export const TextBox = ({ textBox }: Props) => {
|
|||
});
|
||||
|
||||
return (
|
||||
<Box sx={css}>
|
||||
<Box style={css}>
|
||||
<Box
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
|
|
Loading…
Reference in a new issue