bugGNUstep - Bugs: bug #11557, -hitTest: should check frame...

Group
 
 

bug #11557: -hitTest: should check frame rotation.

Submitter:  None
Submitted:  Mon 10 Jan 2005 07:01:54 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 19 Jan 2008 11:44:11 PM UTC, comment #7: 

Closed as there was no further feedback for half a year after my last update.

Fred Kiefer <FredKiefer>
Group Member
Tue 10 Jul 2007 12:12:01 PM UTC, comment #6: 

I think this was corrected on the 2006-10-19 by Greg with a patch from Banlu Kemiyatorn.

Fred Kiefer <FredKiefer>
Group Member
Mon 28 Feb 2005 07:15:40 PM UTC, comment #5: 


> Note that the line from -hitTest: that you quoted tests whether the point is inside the super view, not the view itself.


But it checks against the view's _frame, not _super_view's bounds.
So you should check only when the view isn't rotated. (the top
view shouldn't be rotated anyway)

the _frame is the origin of the view in _super_view (and size)
but not the view's actualy layout. Just create a simple button and
rotate it by 90 degree. You won't be able to click on it face
since it will never know that the view is completely fall off _frame.

Anonymous
Mon 28 Feb 2005 04:34:43 PM UTC, comment #4: 

Note that the line from -hitTest: that you quoted tests whether the point is inside the super view, not the view itself. Further. the very next line is:

>  p = [self convertPoint: aPoint fromView: _super_view];


so the point should be converted ok. Do you have a test case where this breaks?

Alexander Malmberg <alexm>
Group Member
Mon 28 Feb 2005 08:20:36 AM UTC, comment #3: 

It should be transformed first because if the frame is rotated
and you didn't check the hit point against the matrix, you will
never know if the point is in the rotated view or not.

_____________
_/\__________
_/_\_________
/_Y_\________
\___/________
_\_/_X_______
_\/__________
_____________

If the view (given a button) is rotated, we should transform X to Y or
the hitTest: will return incorrect result (out of frame). For a bit more
efficient, just check if the view is rotated or not so we don't need
to transfrom the point when not neccessary.

Anonymous
Sat 12 Feb 2005 12:27:53 AM UTC, comment #2: 

Could you please explain why you think the test with the transformed bounds would be better than one with the frame?
I must admit that there are quite a few things that I don't understand with the frame/bounds transformation and for this reason I would not dare to touch.

Fred Kiefer <FredKiefer>
Group Member
Mon 10 Jan 2005 07:58:37 PM UTC, comment #1: 

-removeFromSuperview may want to check too..

      [_super_view setNeedsDisplayInRect: _frame];

the frame should be a converted rect from self bounds to superview..

Anonymous
Mon 10 Jan 2005 07:01:54 PM UTC, original submission:  


  if (_super_view && ![_super_view mouse: aPoint inRect: _frame])
    return nil;

may be aPoint should be convertPoint:fromView:_super_view
and checked against bounds before returning nil.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-19 FredKiefer Open/ClosedIn Test Closed
    2007-07-10 FredKiefer StatusNone Fixed
        Assigned toNone FredKiefer
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code