It is currently August 17th, 2019, 11:47 am

[D2D][Fixed] TransformationMatrix ~ Scale Not working

Backwards compatibility issues related to the conversion of Rainmeter to D2D.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

[D2D][Fixed] TransformationMatrix ~ Scale Not working

eclectic-tech » July 26th, 2018, 12:11 pm

4.2.3111
scale-4-2-3111.gif
4.3.3199
scale-4-3-3199.gif

Code: Select all

[Rainmeter]
Update=50
Dynamicwindowsize=1
LeftMouseDoubleClickAction=[!WriteKeyValue Variables Scaler 1][!Refresh]

[Variables]
Scaler=1
ImageW=128
ImageH=64
MaxDiameter=(SQRT(#ImageW# ** 2 + #ImageH# ** 2))
ImageSW=(#ImageW#*#Scaler#)
ImageSH=(#ImageH#*#Scaler#)
; The rectangle image size is 128x64 pixels
; To use with a different image, change the ImageW & ImageH 'numbers' to match your image size

[mScalerUp]
Measure=Calc
Formula=(#Scaler#+0.01>2.0)? 2.0:(#Scaler#+0.01)
DynamicVariables=1
UpdateDivider=-1
; Measures the next largest size; limits it to 2x

[mScalerDn]
Measure=Calc
Formula=(#Scaler#-0.01<0.1)? 0.1:(#Scaler#-0.01)
DynamicVariables=1
UpdateDivider=-1
; Measures the next smallest size; limits it to .1x

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 360) + 1
MaxValue=360
; Controls rotation

[MeterBG]
Meter=Image
SolidColor=0,0,0,128
W=(#MaxDiameter#*#Scaler#)
H=(#MaxDiameter#*#Scaler#)
MouseScrollUpAction=[!WriteKeyValue Variables Scaler ([mScalerUp])][!Refresh #CurrentConfig#]
MouseScrollDownAction=[!WriteKeyValue Variables Scaler ([mScalerDn])][!Refresh #CurrentConfig#]

[MeterRotate]
Meter=Rotator
MeasureName=MeasureRotate
ImageName=#@#images\rectangle.png
X=([MeterBG:W]/2)
Y=([MeterBG:H]/2)
OffsetX=(#ImageW#/2)
OffsetY=(#ImageH#/2)
TransformationMatrix=(#Scaler#);0;0;(#Scaler#);((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1

[MeterScaleText]
Meter=String
X=([MeterBG:W]/2)
Y=([MeterBG:W]/2)
FontColor=255,255,255
StringAlign=CenterCenter
StringEffect=Shadow
Text=Scale: #Scaler#
@Resources\Images\Rectangle.png:
Rectangle.png
You do not have the required permissions to view the files attached to this post.
User avatar
Brian
Developer
Posts: 1888
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: TransformationMatrix ~ Scale Not working

Brian » July 26th, 2018, 9:15 pm

Should be fixed with r3201. Thanks for reporting!

-Brian
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Fixed] TransformationMatrix ~ Scale Not working

eclectic-tech » July 27th, 2018, 2:02 pm

Scaling works on r3201, but there is a new issue with TransformationMatrix.

When the Scale variable is set to 1 (default value), the TransformationMatrix action rotates the image outside of the skin's width and height. If the Scale variable is not 1, then the TransformationMatrix shows expected rotation and scale...
trans2.gif

Rainmeter 4.3.0.3201 beta (64-bit)
Language: English (1033)
Build time: 2018-07-27 6:48:12
Commit Hash: b5820487
Windows 10 Pro 1803 64-bit (build 17692) - English (1033)
Path: C:\Rainmeter3201_64bit\
SkinPath: C:\Users\John\Rainmeter\Skins\
SettingsPath: C:\Rainmeter3201_64bit\
IniFile: C:\Rainmeter3201_64bit\Rainmeter.ini
:17flag
You do not have the required permissions to view the files attached to this post.
User avatar
Brian
Developer
Posts: 1888
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: TransformationMatrix ~ Scale Not working

Brian » July 27th, 2018, 4:32 pm

Ah, a small mistake fixed with r3202.

Thanks for all the testing!!

-Brian
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Fixed] TransformationMatrix ~ Scale Not working

eclectic-tech » July 27th, 2018, 8:46 pm

:17nodding :17drums :17good