diff options
| author | Zachary Zhang <zacharyzhang7@gmail.com> | 2024-05-12 21:50:44 -0400 |
|---|---|---|
| committer | Zachary Zhang <zacharyzhang7@gmail.com> | 2024-05-12 21:50:44 -0400 |
| commit | 4738bb6d8a9098a49acab771830d0f2029a62de1 (patch) | |
| tree | 261ae0b2fe5ba7b806608ada1c44f92a7d3f8698 /src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx | |
| parent | bd82ad3ebefebd4e8354007568ca27f3e2f13a9b (diff) | |
| parent | 2caf7b7bb80b663b6ba585f88cdbd2d725f8505e (diff) | |
Merge branch 'master' into zach-starter
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx index 08dfb32ad..0acc99360 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormBackgroundGrid.tsx @@ -14,8 +14,8 @@ export interface CollectionFreeFormViewBackgroundGridProps { nativeDimScaling: () => number; zoomScaling: () => number; layoutDoc: Doc; - cachedCenteringShiftX: number; - cachedCenteringShiftY: number; + centeringShiftX: number; + centeringShiftY: number; } @observer export class CollectionFreeFormBackgroundGrid extends React.Component<CollectionFreeFormViewBackgroundGridProps> { @@ -32,7 +32,7 @@ export class CollectionFreeFormBackgroundGrid extends React.Component<Collection const w = this.props.PanelWidth() / this.props.nativeDimScaling() + 2 * renderGridSpace; const h = this.props.PanelHeight() / this.props.nativeDimScaling() + 2 * renderGridSpace; const strokeStyle = this.props.color(); - return !this.props.nativeDimScaling() ? null : ( + return ( <canvas className="collectionFreeFormView-grid" width={w} @@ -41,8 +41,8 @@ export class CollectionFreeFormBackgroundGrid extends React.Component<Collection ref={el => { const ctx = el?.getContext('2d'); if (ctx) { - const Cx = this.props.cachedCenteringShiftX % renderGridSpace; - const Cy = this.props.cachedCenteringShiftY % renderGridSpace; + const Cx = this.props.centeringShiftX % renderGridSpace; + const Cy = this.props.centeringShiftY % renderGridSpace; ctx.lineWidth = Math.min(1, Math.max(0.5, this.props.zoomScaling())); ctx.setLineDash(gridSpace > 50 ? [3, 3] : [1, 5]); ctx.clearRect(0, 0, w, h); |
