bugGnash - The GNU Flash player - Bugs: bug #21923, Masks are being ignored for mouse...

 
 

bug #21923: Masks are being ignored for mouse events

Submitter:  Udo Giacomozzi <udog>
Submitted:  Mon 31 Dec 2007 04:22:23 PM UTC
   
 
Category:  core Severity:  3 - Normal
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  strk
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 23 Jan 2008 02:31:35 PM UTC, comment #17: 

Confirm it's fixed now.

However, with OpenGL only a part of the shape is being rendered. Only the upper part of the dashed circle outline is visible.

Udo Giacomozzi <udog>
Group Member
Wed 23 Jan 2008 02:22:15 PM UTC, comment #16: 

All done.

Sandro Santilli <strk>
Group Member
Wed 23 Jan 2008 02:13:34 PM UTC, comment #15: 

Found the culprit.
When both fill_bits and line_bits are zero we skip.
There's a comment about that , the fact is ugly, and we
were waiting for next bug item.
Good we have the item now.


Sandro Santilli <strk>
Group Member
Wed 23 Jan 2008 01:59:04 PM UTC, comment #14: 

FYI: I tried with cairo and have the same problem

Sandro Santilli <strk>
Group Member
Wed 23 Jan 2008 01:53:36 PM UTC, comment #13: 

Seems like the problem is that there is no outline in the shape. Note dashed lines are really exported as shapes. Adding a single hairline somewhere (no matter where) in the shape makes the whole shape appear correct.

I'm currently trying to figure out what's the problem and if it's AGG related.

Udo Giacomozzi <udog>
Group Member
Wed 23 Jan 2008 01:39:44 PM UTC, comment #12: 

No idea, could also be the same bug as bug #22000..
Can you try to figure out, having the source&framework
to easily change it ?

Sandro Santilli <strk>
Group Member
Wed 23 Jan 2008 01:36:28 PM UTC, comment #11: 

Confirm mouse events now respect masks. However, I still see no dashed lines. Perhaps they are being masked out?

Udo Giacomozzi <udog>
Group Member
Wed 23 Jan 2008 12:40:11 PM UTC, comment #10: 

committed.

Sandro Santilli <strk>
Group Member
Wed 23 Jan 2008 12:37:00 PM UTC, comment #9: 

Sorry for the late answer. I confirm the dashed lines are missing in Gnash. Dunno why. I attached a screenshot of how it should be rendered...


Udo Giacomozzi <udog>
Group Member
Wed 23 Jan 2008 11:12:17 AM UTC, comment #8: 

Running the testsuite, bug code is ready... expect a commit shortly.

Sandro Santilli <strk>
Group Member
Sat 19 Jan 2008 09:03:45 AM UTC, comment #7: 

I've been thinking about the hit test and masks problem.
A naive implementation could keep the current top-down search,
but would result in a lot of hitTest calls for layer masks
when a single would suffice for a set of depths instead.

A better implementation would instead, inside a DisplayList,
skip a block of depth when the query point doesn't hit the
layer mask for that block.

To generalize, could proceed as in a ::display
call, stacking on a vector (rather then on the actual display)
all the characters being hit by the point.
Finally, we'd get the top of the stack.
This could again be poorly performant though, doing hit tests
for characters at lower depths when we're only interested
about higher ones.

Sandro Santilli <strk>
Group Member
Sat 19 Jan 2008 08:20:17 AM UTC, comment #6: 

Udo, I don't see the dashed lines at all with Gnash, is it a separate bug ?

Sandro Santilli <strk>
Group Member
Fri 11 Jan 2008 10:49:39 AM UTC, comment #5: 

get_topmost_mouse_entity starts from the root,
it's a recursive thing as usual.

IFF the currently-being-scanned MovieClip can handle
mouse events, all childs are only scanned for visibility
(to check if the pointer falls in the visible shape
of this characters and any children).

Note this is a yet-to-be-fully-redesigned thing,
anyway some improvements in the interface are there,
like pointInShape() and pointInVisibleShape() which
may be used to come out with a new implementation.

Another situation in which I needed a better interface
was for _droptarget support. I made another get_topmost_mouse_entity-like crap for it, but I'm not
really satisfied.

Maybe what we need is a function that scans the whole
display list and returns all matches ... but would
be less peformant then a stateful thing.

Another tought would be a visitor-like thing, basically
an iterator that can go deep-first or bread-first into
it to be used by a stateful scanner to find out different
things, early-returning when needed.

NOTE that for _droptarget we currently do a double scan
for exactly the lack of good interface for these kind
of things in the core...

Sandro Santilli <strk>
Group Member
Fri 11 Jan 2008 08:55:15 AM UTC, comment #4: 

Re testcase: This is about events, so why we need pixel checking and invalidated bounds? We would just need to check if a masked button gets a click event where the mask hides it.

Re implementation: DisplayList knows the mask while it recursively walks the object hierarchy and maintains state information while doing so.

For the mouse event problem (note I am not familiar with get_topmost_mouse_entity) it will be tricky. We would need to know if a particular coordinate is masked. Now that I think of it: get_topmost_mouse_entity probably already scans for the object that is (hit test) at that mouse coordinate and can receive the event. While doing so it probably also finds the masks and could evaluate them.

However it would need to scan all objects up to the root movie. Don't know if get_topmost_mouse_entity() currently stops at the first match..

Udo Giacomozzi <udog>
Group Member
Tue 01 Jan 2008 11:09:09 AM UTC, comment #3: 

The best testcase for these cases (user-interaction required)
would be one self-explaining, like a textfield with instructions
should do.

Then, the MovieTester-based runner would follow the instructions
and trigger self-contained testcases. Ideally there should be
no need for pixel checking to figure out results, so not to require
eye scan for human tests (just a final totals report, using the
dejagnu clip).

Of course pixel-checking and inv.bounds. will be possible to
add anyway in the runner as an additional layer of testing.

As for impelmentation, I guess DisplayList would know what mask
is active so could pass an additional argument to get_topmost_mouse_entity and getDropTarget to signify the mask
(or masks, for nested ones?).
The hit testers would then first check the mask (if any), if
the pointer is in the mask there would be no hit, otherwise
there's an hit if the pointer is in the character shape.
What to check first and what next might use an heuristic for
an estimated checking cost (but yes, we're going too far :)

Note that for dynamic masks each character have a pointer to
its mask, no need for DisplayList to find out, still needed
for static ones.

Sandro Santilli <strk>
Group Member
Tue 01 Jan 2008 11:00:00 AM UTC, comment #2: 


> Are mask important both when static (mask layer, defined by PlaceObject*) and dynamic (using setMask) ?


Yes.

For the rest: will try soon

Udo Giacomozzi <udog>
Group Member
Tue 01 Jan 2008 10:53:31 AM UTC, comment #1: 

Are mask important both when static (mask layer, defined by PlaceObject*) and dynamic (using setMask) ?

Could you try to add code to one of the existing automated
testcases for this case ?

misc-ming.all/masks_test.c could be a good start, something like making a square with the color of the sprite hit by the mouse onMouseOver... or a completely new test as new ones are better
self-explained then old ones

Sandro Santilli <strk>
Group Member
Mon 31 Dec 2007 04:22:23 PM UTC, original submission:  

A masked movieclip/button should only receive mouse events where it is visible. Gnash does not care about any masks when handling mouse events.

A example is attached. It shows a rectangle-shaped button with a circle-shaped mask. Dashed lines show the full extends of these shapes. The button should not show the red hover color when the mouse is near the rectangle corners and outside the circle.

I hope my exmplanation is clear.

Udo Giacomozzi <udog>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #14857:  mouse-mask-test.png added by udog (18KiB - image/png)
file #14833:  hitMask.swf added by strk (530B - application/x-shockwave-flash - setMask based testcase)
file #14834:  hitMask.as added by strk (1KiB - application/x-applix-spreadsheet - setMask based testcase)
file #14728:  mouse-mask-test.swf added by udog (3KiB - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by udog (Submitted the item)
  •  

    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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-23 strk StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2008-01-23 strk StatusIn Progress Ready For Test
    2008-01-23 udog Attached File- Added mouse-mask-test.png, #14857
    2008-01-23 strk StatusConfirmed In Progress
        Assigned toudog strk
    2008-01-19 strk Attached File- Added hitMask.swf, #14833
        Attached File- Added hitMask.as, #14834
    2008-01-01 strk StatusNone Confirmed
        Assigned toNone udog
    2007-12-31 udog Attached File- Added mouse-mask-test.swf, #14728

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code