Giter VIP home page Giter VIP logo

Comments (7)

dropcapdreams avatar dropcapdreams commented on July 28, 2024 3

@blcarson Dont' know if you know, but the latest version of Sketch now has this functionality built in and it works great. On the mac it's Function + arrow (left or right)

from sketch-artboard.

blcarson avatar blcarson commented on July 28, 2024

Haven't found a way to do this myself. Resorted to resizing my window so that on artboard switch it ended up zooming to 100%

from sketch-artboard.

dropcapdreams avatar dropcapdreams commented on July 28, 2024

@ntgxtreme @blcarson I had the same issue, when going to the next Artboard it would "Zoom to Fit" the Artboard. I was able to make a small edit to the code so if your viewing at 100% and go to the next Artboard, it would stay at 100% (no zooming to fit). The only issue is if your zoomed in and your Artboard is larger then the view port width, then it reverts back to "Zoom to Fit". This is usually never the case for me as I usually switch Artboards at 100% view or even less sometimes.

I changed line 93 from:
var newZoomValue = viewportWidth / newWidth;
to
var newZoomValue = [doc zoomValue];

Basically keeps the zoom view as is, instead of assigning a new one. I'm not sure if this is @kenmoore intention, but I find it makes this plugin 1000x more useful.

from sketch-artboard.

neuedeutsche avatar neuedeutsche commented on July 28, 2024

mhm i made the change as suggested by @dropcapdreams but that makes the artboard stick to the top of the viewport, also not ideal.

basicly we dont want it to deal with zooming at all just switch to the next artboard and do whatever cmd + 3 would do in one step am i right?

from sketch-artboard.

dropcapdreams avatar dropcapdreams commented on July 28, 2024

@derGraph

I made another edit but forgot to mention it here sorry!

You need to change line 93 AND 94 from:

var newZoomValue = viewportWidth / newWidth;
var newY = Math.max([nextArtboardRect y], [nextArtboardRect y] - ([currentArtboardRect y] + scrollOrigin.y / zoomValue));

TO

var newZoomValue = [doc zoomValue];
var newY = Math.max([nextArtboardRect y] - ([currentArtboardRect y] + scrollOrigin.y / zoomValue));

After doing this, this will not only prevent the document to zoom to 100% width but also keep the exact view position. I use it all the time, love it.

from sketch-artboard.

blcarson avatar blcarson commented on July 28, 2024

@dropcapdreams that worked perfect, thank you!

from sketch-artboard.

blcarson avatar blcarson commented on July 28, 2024

Did not - thanks for the heads up!

from sketch-artboard.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.