It is currently March 29th, 2024, 5:43 am

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

I'm afraid I don't follow at all. If you specify 99 as the ending point for the line(s) or the rectangle(s), why wouldn't they end at 99?

Did you try this?

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
colorBackground=0,0,191,255
colorTitleBar=0,16,64,255
colorDivider=200,200,200,255

[mtrBackground]
Meter=Shape
Shape=Rectangle 0,0,100,100,7 | StrokeWidth 0 | Fill Color #colorBackground#
Shape2=Rectangle 0,0,100,20,7 | StrokeWidth 0 | Fill Color #colorTitleBar#
Shape3=Rectangle 0,10,100,10 | StrokeWidth 0 | Fill Color #colorTitleBar#
AntiAlias=1
X=100
Y=100
W=100
H=100

[mtrDividers]
Meter=Shape
Shape=Line 20,20,20,100 | Extend DividerModifiers
Shape2=Line 23,20,23,100 | Extend DividerModifiers
Shape3=Line 40,0,40,100 | Extend DividerModifiers
Shape4=Line 43,0,43,100 | Extend DividerModifiers
DividerModifiers=StrokeWidth 2 | Stroke Color #colorDivider#
AntiAlias=1
X=100
Y=100
W=100
H=100

[mtrDividers2]
Meter=Shape
Shape=Rectangle 60,20,2,80 | Extend DividerModifiers
Shape2=Rectangle 63,20,2,80 | Extend DividerModifiers
Shape3=Rectangle 80,0,2,100 | Extend DividerModifiers
Shape4=Rectangle 83,0,2,100 | Extend DividerModifiers
DividerModifiers=StrokeWidth 0 | Fill Color #colorDivider#
AntiAlias=1
X=100
Y=100
W=100
H=100
1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

jsmorley wrote: January 11th, 2019, 11:27 pm I'm afraid I don't follow at all. If you specify 99 as the ending point for the line(s) or the rectangle(s), why wouldn't they end at 99?
I know why he thought that: because from 0 to 99 there are 100px. That's the same height as the rectangles have. So ... he thought the lines and the rectangles should extend on the same height / px. In theory, he isn't wrong. Now you're the best when it comes to practice, so maybe you can explain how this works.

For example, your lines, jsmorley, have 101 px, because they go from Y=0 to Y=100.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

Yincognito wrote: January 11th, 2019, 11:42 pm I know why he thought that: because from 0 to 99 there are 100px. That's the same height as the rectangles have. So ... he thought the lines and the rectangles should extend on the same height / px. In theory, he isn't wrong. Now you're the best when it comes to practice, so maybe you can explain how this works.

For example, your lines, jsmorley, have 101 px, because they go from Y=0 to Y=100.
But Line meters are not based on "width" or "height", as Rectangle meters are. They are base on "start" and "stop".
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

jsmorley wrote: January 11th, 2019, 11:47 pm But Line meters are not based on "width" or "height", as Rectangle meters are. They are base on "start" and "stop".
True. So they should start at pixel 0 all the way to pixel 100, right? Including pixel 0, that is.

0, 1, 2, 3
There are 4 digits (px, in this case) above, not 3...

I'm not trying to argue here, I'm just trying to explain why he thought as he thought - whether he was right or wrong in practice (i.e. how Rainmeter or the Shape meters work). But then, maybe it depends on the stroke width, who knows?
Last edited by Yincognito on January 11th, 2019, 11:59 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 0,0,2,100 | StrokeWidth 0 | Fill Color 255,255,255,255

[Shape2]
Meter=Shape
Shape=Line 10,0,10,100 | StrokeWidth 2 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=20R
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]
1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

jsmorley wrote: January 11th, 2019, 11:59 pm

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 0,0,2,100 | StrokeWidth 0 | Fill Color 255,255,255,255

[Shape2]
Meter=Shape
Shape=Line 10,0,10,100 | StrokeWidth 2 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=20R
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]

1.jpg
As I said, it depends on the stroke width:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 0,0,2,100 | StrokeWidth 1

[Shape2]
Meter=Shape
Shape=Line 10,0,10,100 | StrokeWidth 1 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=20R
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

I'm not sure what the underlying logic is, but the overt logic is fine for me. When you specify a Rectangle with a forced height of 100 and no StrokeWidth, I would expect it to be 100 pixels in height. If I start a Line at 0 and end it at 100, I would expect it to be 100 pixels in height.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

StrokeWidth on a Rectangle is a whole different animal. In that case the actual size of the "shape" is defined by the rectangle, with the drawn stroke being one-half "inside" and one-half "outside" the defined shape.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 1,1,2,100 | StrokeWidth 2 | Stroke Color 255,0,0,255 | Fill Color 255,255,255,255

[Shape2]
Meter=Shape
Shape=Line 10,0,10,100 | StrokeWidth 2 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=20R
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]
1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

jsmorley wrote: January 12th, 2019, 12:05 am I'm not sure what the underlying logic is, but the overt logic is fine for me. When you specify a Rectangle with a forced height of 100, I would expect it to be 100 pixels in height. If I start a line at 0 and end it at 100, I would expect it to be 100 pixels in height.
I fully agree on the 1st part. Not on the second though. Would you expect a line that starts at 0 and ends at 0 to have -1 px in height?!
Well, neither do I, because its height is 1px, as this shows as well:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 0,0,2,100 | StrokeWidth 1

[Shape2]
Meter=Shape
Shape=Line 10,0,10,0 | StrokeWidth 1 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=20R
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]
Therefore, a line that starts at 0 and ends at 100 will have ... 101 px - just like my previous post showed.
jsmorley wrote: January 12th, 2019, 12:07 am StrokeWidth on a Rectangle is a whole different animal. In that case the actual size of the "shape" is defined by the rectangle, with the drawn stroke being one-half "inside" and one-half "outside" the defined shape.
As I said, you are the best when it comes to practice. Maybe this explained what he experienced, but it doesn't quite explain lines from 0 to 100 having just 100px when the stroke width is 1 - sorry if I disagree.

EDIT: Maybe stroke width has a similar influence on lines, even if they are 1 px thick? That would probably explain things better.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

Dunno... A Line that starts at 0 and ends at 0 with a StrokeWidth of 1 has a height of 1, not 0 or -1, but in fact as far as I can tell is not actually "drawn".

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,255

[Shape1]
Meter=Shape
Shape=Rectangle 0,0,2,100 | StrokeWidth 0

[Shape2]
Meter=Shape
Shape=Line 10,0,10,0 | StrokeWidth 1 | Stroke Color 255,255,255,255

[MeterHeight]
Meter=String
Y=110
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[Shape1:H] : [Shape2:H]
2.jpg
You do not have the required permissions to view the files attached to this post.