Skip to content

Small window/large paper? #2550

Answered by kumilingus
dmb0058 asked this question in Q&A
Feb 26, 2024 · 2 comments · 16 replies
Discussion options

You must be logged in to vote

The issue is there was a breaking change in v4 regarding the grid and paper events.
In version 4 the grid is updated on transform event (not present in v3.7).

const panZoom = svgPanZoom(paper.svg, {
      viewportSelector: paper.layers,
      zoomEnabled: true,
      panEnabled: false,
      controlIconsEnabled: true,
      maxZoom: 2,
      minZoom: 0.1,
      onUpdatedCTM: (function() {
          let currentMatrix = paper.matrix();
          return function onUpdatedCTM(matrix){
              const { a, d, e, f } = matrix;
              const { a: ca, d: cd, e: ce, f: cf } = currentMatrix;
              const translateChanged = (e !== ce || f !== cf)
              if (translateChanged)

Replies: 2 comments 16 replies

Comment options

You must be logged in to vote
10 replies
@DarkMagus
Comment options

@kumilingus
Comment options

@DarkMagus
Comment options

@kumilingus
Comment options

@DarkMagus
Comment options

Answer selected by dmb0058
Comment options

You must be logged in to vote
6 replies
@kumilingus
Comment options

@DarkMagus
Comment options

@kumilingus
Comment options

@DarkMagus
Comment options

@kumilingus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants