It is currently April 27th, 2024, 8:46 pm

MouseOver/MouseLeave Issues With Transparent Images

Report bugs with the Rainmeter application and suggest features.
Ammorth
Posts: 3
Joined: August 4th, 2012, 5:24 pm

MouseOver/MouseLeave Issues With Transparent Images

Post by Ammorth »

I noticed a really weird behavior with transparent images and their mouseover and mouseleave areas. An image's mouseover area is any coordinate within the image's dimensions, as long as that coordinate isn't transparent for the entire skin. Basically, if you have an image with a transparent border, and place that image on top of any other opaque meter, the parts of the opaque meter that are within the dimensions of the image count toward that image's mouseover.

Although the test case I uploaded usually wouldn't happen in reality, it is a clear example of the problem. In my project, I'm working with circles and the corner borders are being considered for mouseover. I tried a workaround using a full roundline meter, but it appears that doesn't support mouseover.

If you know of any workaround for the time being, please let me know.
You do not have the required permissions to view the files attached to this post.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: MouseOver/MouseLeave Issues With Transparent Images

Post by MerlinTheRed »

This has always been the normal behavior of Rainmeter. Fully transparent regions aren't interactive, a click on any slightly opaque location counts towards the topmost meter that covers this location. Every meter in Rainmeter has a rectangular, axis-aligned area. Some of that area might be transparent, but they are still considered a part of the meter. I'm not sure if this can (or should be) fixed, since some people use it as a feature. The only workaround I can think of is using smaller "invisible" image meters to put together an approximate interactive area and let those images handle the interaction rather than the original meter.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOver/MouseLeave Issues With Transparent Images

Post by jsmorley »

Yes, this is a known issue. The rule "the mouse is ignored on transparent areas of an image" is only true if the image with transparent areas does not have another meter with opaque pixels at the same X/Y location in the skin. There really is no good workaround at this time, other than to design the skin in such a way that you account for this behavior.
Ammorth
Posts: 3
Joined: August 4th, 2012, 5:24 pm

Re: MouseOver/MouseLeave Issues With Transparent Images

Post by Ammorth »

Thanks for the quick reply guys.

I was hoping for a cleaner way than to use multiple smaller meters for the area, but I guess I'm SOL. It's a shame the whole "backwards compatible" thing keeps little quirks like these from being fixed. However, as I developer, I know how terrible things get if you suddenly pull legacy support.

Once again, thanks guys.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MouseOver/MouseLeave Issues With Transparent Images

Post by jsmorley »

Ammorth wrote:Thanks for the quick reply guys.

I was hoping for a cleaner way than to use multiple smaller meters for the area, but I guess I'm SOL. It's a shame the whole "backwards compatible" thing keeps little quirks like these from being fixed. However, as I developer, I know how terrible things get if you suddenly pull legacy support.

Once again, thanks guys.
Glad to help. Rainmeter is particularly sensitive to backwards compatibility issues, as one of the most important things we have is the Rainmeter community and the many, many thousands of existing skins out there on deviantART and Customize.org. Some of the most popular skins are older and the authors are no longer updating them, so making a change with any kind of serious BWC impact would just be catastrophic.