It is currently September 21st, 2021, 6:07 pm

## Transformation matrix and circle issue

Help with creating, editing & fixing problems with skins
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

### Transformation matrix and circle issue

Hello all.
I'am working on a clock skin and I have two weird issues.

code:
Image;

As you can see from the image I think there are two issues: the first (number 1) there is a vertical line but the circle should have a "solid" color, and the second (number two) I think that the issue come from the code of the "TransformationMatrix" option.

For the "TransformationMatrix" option, how do I get the left side of the rectangle aligned with the gray line (it would be 1 hour on the clock)? Currently, the gray line cuts the rectangle at an angle.

You do not have the required permissions to view the files attached to this post.
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Transformation matrix and circle issue

FreeRaider wrote: July 21st, 2021, 4:44 pm the first (number 1) there is a vertical line but the circle should have a "solid" color,
For this you should add a Solid=1 option to the [MeterDial_5] meter.
FreeRaider wrote: July 21st, 2021, 4:44 pm the second (number two) I think that the issue come from the code of the "TransformationMatrix" option.

For the "TransformationMatrix" option, how do I get the left side of the rectangle aligned with the gray line (it would be 1 hour on the clock)?
I'd definitely not recommend you to put the [MeterSquare] meter to X=0 and Y=0. Instead I'd place both, the line (the [MeterDial_5] meter, which doesn't necessary has to be a Roundline, it might be a Shape meter as well) and the string (the [MeterSquare] meter) to the same position and would rotate both with TransformationMatrix. Note that you'll need twelve such line - string pairs, right?
I'm writing an example and will post it soon back here. Stay tuned...
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Transformation matrix and circle issue

Finally here is the code I've promised. Take a look, please:

Code: Select all

``````[RoundlineStyle]
RotationAngle=0
X=0
Y=0
LineColor=afafaf
AntiAlias=1
Solid=0

[StringStyle]
SolidColor=255,0,0,255
FontFace=Courier New
FontSize=12
AntiAlias=1
StringAlign=CenterCenter

[MeterDial_12]
Meter=Roundline
MeterStyle=RoundlineStyle

[MeterSquare12]
Meter=string
MeterStyle=StringStyle
Text=12

[MeterDial_5]
Meter=Roundline
MeterStyle=RoundlineStyle

[MeterSquare5]
Meter=string
MeterStyle=StringStyle
Text=1

[MeterDial_10]
Meter=Roundline
MeterStyle=RoundlineStyle

[MeterSquare10]
Meter=string
MeterStyle=StringStyle
Text=2

[MeterDial_15]
Meter=Roundline
MeterStyle=RoundlineStyle

[MeterSquare15]
Meter=string
MeterStyle=StringStyle
Text=3

[MeterDial_20]
Meter=Roundline
MeterStyle=RoundlineStyle

[MeterSquare20]
Meter=string
MeterStyle=StringStyle
Text=4
Note the followings:
• As previously said, beside the String meters, I transformed (rotated) the Roundline meters as well.
• I wrote only the first four pairs. The others are similar and I hope you can figure out how to write them (see the following points as well).
• I used two style sections ([RoundlineStyle] and [StringStyle]), in order to reduce the length of the Roundline and String meters. In fact the Roundline and the String meters have only the TransformationMatrix options and the String meters the Text options. Everything else are the same for the similar meters.
• The TransformationMatrix options of the pair meters are the same. In each such TransformationMatrx option you have to replace the "indices" (eight times for each TransformationMatrix), which are the numbers (12, 1, 2, 3 and 4 in the above TransformationMatrix options). Obviously you'll have to use the following numbers (up to 11).
If you don't understand something please let me know what is that, to can assist you.
Is this what you wanted?
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

### Re: Transformation matrix and circle issue

balala wrote: July 21st, 2021, 5:48 pm For this you should add a Solid=1 option to the [MeterDial_5] meter.
Issue is in [MeterBG] and I don't understand why I see a vertical line. It's like the solid option doesn't complete the circle.

balala wrote: July 21st, 2021, 6:26 pm Finally here is the code I've promised. Take a look, please:
I'm working on it. I will let you know.

Thank you very much as always
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Transformation matrix and circle issue

FreeRaider wrote: July 21st, 2021, 7:50 pm Issue is in [MeterBG] and I don't understand why I see a vertical line. It's like the solid option doesn't complete the circle.
Sorry, it seems I misunderstood you.
Yes, you're right, the line is there. Weird is that it can be seen only for the StartAngle=(Rad(270)) value of the StartAngle. If you change it to any other value (except the values which are "complementar", -90 for instance) the line disappears. Don't know what to say.
Maybe a dev would be needed here...
Yincognito
Rainmeter Sage
Posts: 4052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

### Re: Transformation matrix and circle issue

FreeRaider wrote: July 21st, 2021, 7:50 pmIssue is in [MeterBG] and I don't understand why I see a vertical line. It's like the solid option doesn't complete the circle.
Removing or commenting out AntiAlias=1 from the meter should fix it, because it's about the rounding errors when it comes to pixels ... but then the circle's contour / edges will not be that smooth, so there is a drawback to it. Why not using the Ellipse shape to draw a full (and either filled or not) circle though?

Code: Select all

``````[MeterBG]
Meter=Shape
AntiAlias=1
``````
Also, just curious, is there a reason why you use TransformationMatrix for the dials and texts? Do you envision some other transformation, i.e. scaling or skewing for the future maybe? The dials can be drawn very easy just by modifiying the StartAngle option accordingly for each one of them, and Strings can also be rotated directly.
Yincognito
Rainmeter Sage
Posts: 4052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

### Re: Transformation matrix and circle issue

balala wrote: July 21st, 2021, 8:30 pmWeird is that it can be seen only for the StartAngle=(Rad(270)) value of the StartAngle. If you change it to any other value (except the values which are "complementar", -90 for instance) the line disappears.
No, it doesn't dissapear, it's just that you don't see it because your desktop under that angle is probably darker. Move the skin towards a lighter area of your desktop and you'll see what I mean: the "gap" is always there (basically, it's about 0.00... degrees that are "transparent").
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Transformation matrix and circle issue

Yincognito wrote: July 21st, 2021, 8:41 pm No, it doesn't dissapear, it's just that you don't see it because your desktop under that angle is probably darker. Move the skin towards a lighter area of your desktop and you'll see what I mean: the "gap" is always there (basically, it's about 0.00... degrees that are "transparent").
Yep, you're right. Not sure what to say, may this be a bug?
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Transformation matrix and circle issue

Yincognito wrote: July 21st, 2021, 8:35 pm Removing or commenting out AntiAlias=1 from the meter should fix it, because it's about the rounding errors when it comes to pixels ... but then the circle's contour / edges will not be that smooth, so there is a drawback to it.
Sorry, just realized I missed this before posting my previous reply, so no bug.
Yincognito wrote: July 21st, 2021, 8:35 pm Also, just curious, is there a reason why you use TransformationMatrix for the dials and texts? Do you envision some other transformation, i.e. scaling or skewing for the future maybe? The dials can be drawn very easy just by modifiying the StartAngle option accordingly for each one of them, and Strings can also be rotated directly.
You mean by the Angle option? If you do, rotating the String meter with TransformationMatrix is much more precise. You can easily get / change the rotation center.
Yincognito
Rainmeter Sage
Posts: 4052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

### Re: Transformation matrix and circle issue

balala wrote: July 21st, 2021, 8:55 pmYou mean by the Angle option? If you do, rotating the String meter with TransformationMatrix is much more precise. You can easily get / change the rotation center.
Yes, that's true, but wouldn't this be eased by setting the StringAlign to CenterCenter? Didn't try it, but it should work in theory, shouldn't it?
If the above is true, it would only leave the angle to be taken care of in that Angle option, and that is just as easy as for the TransformationMatrix, if I'm not mistaken.

P.S. Don't know if it's a bug or not, it depends on the interpretation. Technically, this is logical to happen, but from a user point of view it isn't the expected behavior (especially since the manual mentions a full circle when omitting MeasureName from the meter).