This is an automated notification sent by Savannah.
It relates to:
                bugs #11569, project GNUstep

==============================================================================
 OVERVIEW of bugs #11569:
==============================================================================

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11569>

                 Summary: -setFrameOrigin: and -setFrameRotation:
                 Project: GNUstep
            Submitted by: None
            Submitted on: Tue 01/11/2005 at 23:47
                Category: None
                Severity: 5 - Average
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________


If I want to setFrameOrigin: (or setFrame:) correctly

while keeping old rotation angle, I must keep the old

angle first, then set frame rotation to 0, then set origin

then set frame rotation to old angle.



This code will let the button rotate and move the frame.

But it doesn't work properly on GNUstep but Cocoa.

(you may want to keep calling it a few times to produce

the unexpected result)



- (void) buttonPush:(id)sender

{



                float oldAngle = [aView frameRotation];

                [aView setFrameRotation:oldAngle + 10];



                NSRect oldRect = [aView frame];

                [aView setFrame:NSOffsetRect(oldRect,10,10)];

        [[aView superview] setNeedsDisplay:YES];

}



a small workaround can fix it.



- (void) buttonPush:(id)sender

{



                float oldAngle = [aView frameRotation];

                [aView setFrameRotation:oldAngle + 10];



                NSRect oldRect = [aView frame];



                [aView setFrameRotation:0]; //hack1



                [aView setFrame:NSOffsetRect(oldRect,10,10)];



                [aView setFrameRotation:oldAngle + 10]; //hack2



        [[aView superview] setNeedsDisplay:YES];

}










==============================================================================

This item URL is:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11569>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to