Hi Igor,
I added this method to CAAT, which basically solves your algorithmic problems:
/**
* Scale this actor by the given scales (scaleX,scaleY) at an screen coordinate.
* The coordinate of the pointer (x,y) must not be inside the actor.
* @param x {number}
* @param y {number}
* @param scaleX {number}
* @param scaleY {number}
* @returns {*}
*/
setScaleAtScreenPosition : function( x, y, scaleX, scaleY ) {
var positionInLocal= new CAAT.Point(x,y,0);
this.viewToModel( positionInLocal );
this.setPosition(
x - positionInLocal.x,
y - positionInLocal.y );
this.setScaleAnchored( scaleX, scaleY, positionInLocal.x/this.width, positionInLocal.y/this.height );
return this;
},
You can direct your CAAT/CocoonJS based inquiries to
devsu...@ludei.com or to caat googlegroup.
I usually don't answer algorithm related issues, or things that are solved in any of the numerous CAAT samples available, but try to point to the right sample file.
Last week you asked me for advice on this subject, and after reviewing the email, i realize i had not sent you a modified version of CAAT.Math.Matrix object. sorry about that.
Hope this fits your needs.
Best.