Skip to content

Commit

Permalink
Fix a bug that grid scaling to be incorrect with `scalingObjects: tru…
Browse files Browse the repository at this point in the history
…e` (#17)
  • Loading branch information
dash14 committed Nov 20, 2021
1 parent 6f50aa5 commit c08b7be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/background-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type LineDefinitions = [number, number, number, number, Record<string, any>][]
const { emitter } = useEventEmitter()
const { container, svgPanZoom } = useContainers()
const { scale } = useZoomLevel()
const { zoomLevel } = useZoomLevel()
const config = useViewConfig()
// left-top point in SVG coordinates
Expand Down Expand Up @@ -62,7 +62,7 @@ watchEffect(() => {
const normalH: LineDefinitions = []
const normalV: LineDefinitions = []
const s = scale.value
const s = 1 / zoomLevel.value
const gi = config.grid.interval
const x = basePoint.value.x * s
const y = basePoint.value.y * s
Expand Down Expand Up @@ -129,7 +129,7 @@ defineExpose({
normalHorizontals,
})
</script>

<template>
<g class="v-background-grid" shape-rendering="crispEdges">
<!-- normal -->
Expand Down

0 comments on commit c08b7be

Please sign in to comment.