Code Monkey home page Code Monkey logo

Comments (3)

acornejo avatar acornejo commented on July 19, 2024

Hi @sattes-faction

I did change the behavior for zooming, but my intention was to make it better, not worse.

Right now, when you zoom in or out, the image is recentered, does something else happen?

The reason for the change was simply to have predictable behavior, since the old code tried to preserve the old center, but this is not always possible (for instance, when you zoom out, if you try to preserve the center then sometimes that will cause part of the cropbox to be outside the image area).

I am open to ideas here (maybe even revert to the old case if you make a good argument for it, or perhaps add an option to switch between the two). My priority is to keep to code clean, simple and easy to use.

I'll wait for your feedback before trying to fix this.

from jquery-cropbox.

acornejo avatar acornejo commented on July 19, 2024

I looked at this issue further, and figured out there was a bug in the centering. Fixed now and bumped versions.

I'll close this issue for now, but if you want the old behavior back, please reply in this issue so we can figure out what to do.

PS: I think I figured out a simple way to get the best of both worlds, available in 0.1.4, please do let me know what you think.

from jquery-cropbox.

sattes-faction avatar sattes-faction commented on July 19, 2024

Hi acornejo,

thanks for your quick feedback and the fix. I did some tests with several images and the zooming/centering works very well now. Before in 1.2. it somehow jumped when starting to zoom, even if the zoom factor did only change for 0.01 for example - I have to add I'm using a jQuery UI slider to have seamless zooming like this:

cropbox = $('#image').data('cropbox');

$("#slider").slider({
  min: 50,
  max: 100,
  slide: function(event, ui) {
    cropbox.zoom(ui.value / 100);
  }
});

But anyway, it's really working well so far, so thank you again for your quick fix!

from jquery-cropbox.

Related Issues (20)

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.