It is currently March 29th, 2024, 12:43 pm

TransformationMatrix and MouseActions

Get help with creating, editing & fixing problems with skins
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

TransformationMatrix and MouseActions

Post by raiguard »

I have been tinkering with TransformationMatrix in an attempt to make ModernGadgets scalable. During my tinkering, I have noticed that when you apply a transformation matrix to a meter, the meter's mouseactions will not update to match the transformation. For example, if you use a transformationmatrix to make a button 4x larger, it will only be able to be clicked in the area it would have been without the matrix.

Is this a limitation of transformationmatrix, or a bug?
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Brian
Developer
Posts: 2674
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: TransformationMatrix and MouseActions

Post by Brian »

This is a known bug for quite some time (since before I discovered Rainmeter).

While we do want to fix this and similar bugs (like the similar issue for the Angle option on the String meter), it is difficult to preserve backwards compatibility at the same time. A fix will most certainly break a lot of skins. We will have the see if the upsides outweigh the downsides. Either way, it probably won't be fixed anytime soon.

-Brian
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: TransformationMatrix and MouseActions

Post by SilverAzide »

You can work around this by overlaying your meter with a totally transparent image meter that is dynamically sized. Your mouse stuff would then be part of the transparent meter, not the "real" one.

Code: Select all

[SomeMeter]
Meter=...
TransformationMatrix=#Scale#;0;0;#Scale#;#Scale#;#Scale#

[SomeMeter_MouseRegion]
Meter=Image
Solidcolor=0,0,0,0
X=([SomeMeter:X] * #Scale#)
Y=([SomeMeter:Y] * #Scale#)
W=([SomeMeter:W] * #Scale#)
H=([SomeMeter:H] * #Scale#)
DynamicVariables=1
...put your mouse action stuff here, not in SomeMeter...
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: TransformationMatrix and MouseActions

Post by balala »

iamanai wrote:For example, if you use a transformationmatrix to make a button 4x larger
Just an observation: although the Help does mention that for a Button meter
All general meter options are valid, except W and H.
it seems that neither the TransformationMatrix is not applicable to them. Button meters simply disappear if any kind of TransformationMatrix is applied.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: TransformationMatrix and MouseActions

Post by raiguard »

Thank you all for the replies. I had considered silverazide's suggestion, but I decided to see if there were alternatives because that would significantly increase the amount of meters in Disks Meter and the config skins, and my suite already has a significant performance impact (especially Disks Meter - that thing is a monstrous 6100 lines long already!)

balala, I actually don't use button meters. I use images with mouseactions. I actually completely forgot the button Meter existed! It's interesting that that happens with button meters though - definitely a bug that should be fixed.

Personally, I feel these bugs should be fixed as soon as possible. To compromise between fixing them and backwards compatibility, really the only thing that could be done is add yet another option to the [Rainmeter] section, similar to AccurateText. It's not an ideal solution, but it'd work.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: TransformationMatrix and MouseActions

Post by balala »

iamanai wrote:balala, I actually don't use button meters. I use images with mouseactions. I actually completely forgot the button Meter existed! It's interesting that that happens with button meters though - definitely a bug that should be fixed.
That's not necessarily a bug and maybe shouldn't be fixed. A button meter divides the image of the button into three distinct parts. Applying a TransformationMatrix could cause some troubles, because wouldn't be clear to which part of the image should be applied that transformation. If I'm not wrong, something like this could be the explanation why TransformationMatrix is not applicable to such meters.
Same considerations about a Bitmap meter, which also divides the image into more parts (there're not necessarily just three parts, usually are much more, but anyway, the image is divided).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: TransformationMatrix and MouseActions

Post by jsmorley »

There is no bug. It is in the nature of the way Bitmap and Button meters work that you just can't alter the size or orientation of the images or the meters containing the images. You cannot resize, rotate, or crop them.