My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 44: Rotation doesn,t work smoothly if add x offset to shift the handle right.
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by premkan...@gmail.com, Jun 6, 2010
What steps will reproduce the problem?
1.I am using objecthandle library version 2 (oh2) evrything working fine.
2.Everything working (rotate,resize,move) fine if there is no offset.
3.Rotation does not work smoothly with offset thats my requirement.

What is the expected output? What do you see instead?
Rotaion doesn't work properly if I shift handles that is my requirement.

What version of the product are you using? On what operating system?
ObjectHandles-2.0,  


Please provide any additional information below.

I have changed the function in ObjectHandle.as as follow

protected function updateHandlePositions( model:Object ) : void
        {
            var h:Array = handles[model]
            var scroll:Point = getContainerScrollAmount();
            var offset:Number = 
Application.application.currentPage=='rightcan'?400:0;
            if( ! h ) { return; }
            for each ( var handle:IHandle in h )
            {                      
            	if( model.hasOwnProperty("rotation") )
                {
					var a:Number = 	(model.width * 
handle.handleDescriptor.percentageOffset.x / 100) + 
handle.handleDescriptor.offset.x+ 
handle.handleDescriptor.borderthick.x+handle.handleDescriptor.shift.x + 
offset;	
					var b:Number =  (model.height * 
handle.handleDescriptor.percentageOffset.y / 100)  + 
handle.handleDescriptor.offset.y+ 
handle.handleDescriptor.borderthick.y+handle.handleDescriptor.shift.y;	
		
									
	
					tempMatrix.identity();
					tempMatrix.translate(a,b); // The 
tX & ty
					tempMatrix.rotate( toRadians( 
model.rotation ) );					
					tempMatrix.translate( model.x, 
model.y);
									
									
					var p2:Point = 
tempMatrix.transformPoint( zero );					
									
	 
					handle.rotation = model.rotation;
                    handle.x = p2.x  - scroll.x ;
                    handle.y = p2.y  - scroll.y ; 
                }
                else
                {
                    handle.x =  model.x  + (model.width * 
handle.handleDescriptor.percentageOffset.x / 100)  + 
handle.handleDescriptor.offset.x - scroll.x + 
handle.handleDescriptor.borderthick.x+handle.handleDescriptor.shift.x;	
                    handle.y =  model.y  + (model.height * 
handle.handleDescriptor.percentageOffset.y / 100)  + 
handle.handleDescriptor.offset.y - scroll.y+ 
handle.handleDescriptor.borderthick.y+handle.handleDescriptor.shift.y;	
	
                }
            }   
        }


OH2Example.rar
894 KB   Download

Powered by Google Project Hosting