Giter Club home page Giter Club logo

Comments (4)

fljot avatar fljot commented on July 28, 2024

@bluelemonade I don't understand your problem :/ if you still need help, I could try to assist in voice via Telegram or Skype or Google Hangouts.

from gestouch.

bluelemonade avatar bluelemonade commented on July 28, 2024

hello,

you can find a capture of the issue: http://intern.bluelemon.de:8080/share.cgi?ssid=0lYDjOt
( NAS active between 8.00 and 21.00 MET)

you can see the comibation of scaling an rotating. when I change the rotation an change at the same time the scaling smaller then my minimal scaling, the sprite wanders out of the touch points. how can I avoid this.

regards

from gestouch.

fljot avatar fljot commented on July 28, 2024

@bluelemonade well do not transform your object via those scaleX scaleY x and y convenience setters! If you do it this it transforms object relative to it's origin.

I think you should drop all code after // nicht zu klein machen and instead limit the scaling at matrix.scale() call. You don't want to apply too much up/down scale here.
Perhaps something like

const pic = event.target.target as DisplayObject;
...
matrix.translate(-transformPoint.x, -transformPoint.y);
matrix.rotate(gesture.rotation);

if (doScaling) {
  const currPicScale = pic.scaleX;
  const minScaleToApply = 0.7 / currPicScale;
  const maxScaleToApply = 1.1 / currPicScale;
  const scaleToApply = Math.max(minScaleToApply, Math.min(gesture.scale, maxScaleToApply));
  matrix.scale(scaleToApply, scaleToApply);
}

matrix.translate(transformPoint.x, transformPoint.y);
pic.transform.matrix = matrix;

from gestouch.

bluelemonade avatar bluelemonade commented on July 28, 2024

oh, thank you, indeed its stupid to scale the object. thanks

from gestouch.

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.