question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More comfortable zooming on big canvas

See original GitHub issue

I have a very big canvas where items can be located at “top: 6305px; left: 400px;” and even more, sometimes even 20 000 px. When items are so far off the 0,0, then zooming around is not very comfortable is items on canvas do not remain in view and zooming does not work intuitively. I tried to overwrite the zoom functions with trickery to manipulate the translate coordinates, such as:

editor.zoom_out = function(){
    if(this.zoom > this.zoom_min) {
      this.zoom-=0.1;
      this.canvas_y =this.canvas_y - (this.canvas_y/7/this.zoom); //That 7 is just a test
      this.zoom_refresh();
    }
  }

but no success. It requires some kind transformation of canvas coordinates based on zoom multiplier as well as current canvas location but i cannot figure out how. Any ideas on this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dsoiMcommented, Nov 11, 2020

Hey @jerosoler, works absolutely perfect, good job 👍

0reactions
jerosolercommented, Nov 11, 2020

Update version to 0.0.30

Fix! 😉

And add a zoom_value https://github.com/jerosoler/Drawflow#editor Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forum: Canvas Size and Zoom in Percentage? - DeviantArt
As a general rule, you don't want it to be too small (certainly no smaller than 1000 px wide) otherwise you can't add...
Read more >
How to fix extreme zoom - Help & Support - Sparkol
Before you try to correct an extreme zoom issue you should clear any camera position that is set for the elements that have...
Read more >
best CANVAS SIZE for digital art what resolution should you ...
Why is your drawing so pixelated when you're zooming in? ... post your art and resolution that will actually be comfortable when you...
Read more >
Zoom strategies for huge scatterplots with three.js - Observable
This is a nice in-between size: it's more than canvas can hold, but about 1% the size of the data I want to...
Read more >
Teaching Guide: Zoom app in Canvas - UW IT Connect
In your Canvas course, Zoom may appear at the bottom of the course navigation. If you want Zoom to appear higher up the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found