It is currently October 14th, 2019, 7:01 am

Thread for help with the new Shape meter

Help with creating, editing & fixing problems with skins
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Thread for help with the new Shape meter

qwerky » January 12th, 2019, 1:15 am

Okay. Sorry to have caused such a stir. :oops: Now that we have an answer, we will know how to deal with it. :)
User avatar
jsmorley
Developer
Posts: 19543
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

jsmorley » January 12th, 2019, 1:17 am

qwerky wrote:
January 12th, 2019, 1:15 am
Okay. Sorry to have caused such a stir. :oops: Now that we have an answer, we will know how to deal with it. :)
Hehe... a stir once in a while is a good thing...
User avatar
jsmorley
Developer
Posts: 19543
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

jsmorley » January 12th, 2019, 1:24 am

I think maybe this demonstrates it a bit...

https://www.symbolab.com/solver/vector-add-subtract-calculator/0%20%2B%20100

The answer in a vector sense for 0 + 100 is 100.
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Thread for help with the new Shape meter

Yincognito » January 12th, 2019, 1:28 am

jsmorley wrote:
January 12th, 2019, 1:04 am
Yes, I'm actually pretty happy with the fact that a Rectangle with a forced height of 100 will be the same as a Line drawn from 0 to 100 having a height of 100.

I'm not sure if it is "Rainmeter" or the underlying Vector Graphics engine that is making the best attempt it can to treat a Line, which has no "inside", the same as a Rectangle with no StrokeWidth, that has "only inside". But I can live with it.

I will have to bounce this off the code-monkeys before I would go out on a limb in the manual... ;-)
Yep. Me, I'm neither happy or unhappy, since there are arguments both pro and against this, But yeah, it is more user friendly (same width, same ending point, in this case), despite the math and the visuals being ruthlessly obliterated on this, haha! O.O

Things will generally look good for the regular user, but not good for those relying on precise mathematical formulas to draw something on the skin. In my view, the best thing is that we now know about this thing.
jsmorley wrote:
January 12th, 2019, 1:17 am
Hehe... a stir once in a while is a good thing...
Blame it on me. I like stirs ... :twisted:
User avatar
jsmorley
Developer
Posts: 19543
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

jsmorley » January 12th, 2019, 1:34 am

Yincognito wrote:
January 12th, 2019, 1:28 am
Yep. Me, I'm neither happy or unhappy, since there are arguments both pro and against this, But yeah, it is more user friendly (same width, same ending point, in this case), despite the math and the visuals being ruthlessly obliterated on this, haha! O.O

Things will generally look good for the regular user, but not good for those relying on precise mathematical formulas to draw something on the skin. In my view, the best thing is that we now know about this thing.



Blame it on me. I like stirs ... :twisted:
But in a precise mathematical sense, if you draw a line from 0 to 100, isn't that 0 + 100, which is 100, not 101. It's really not the same thing as the number of elements in an array from 0 to 100.
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Thread for help with the new Shape meter

Yincognito » January 12th, 2019, 1:38 am

jsmorley wrote:
January 12th, 2019, 1:34 am
But in a precise mathematical sense, if you draw a line from 0 to 100, isn't that 0 + 100, which is 100, not 101. It's really not the same thing as the number of elements in an array from 0 to 100.
Yeah, I realized it after I wrote the above, and was about to correct myself - you're right. What I meant was that it only changes things if you are used with the system from most of the other visual applications (Photoshop being the best example). I would make another comparison: this is just as convenient as the 0!=1 convention - it doesn't make much sense (from a pixel by pixel POV in this case), but it definitely makes some things much easier and convenient.

It seems that I'm starting to lean into the happy side with this... :D
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Thread for help with the new Shape meter

qwerky » January 12th, 2019, 9:57 pm

jsmorley wrote:
January 12th, 2019, 12:56 am
[If] you draw a line from 0 to 0 or 110 to 110, that is logically a "singularity" in the realm of Cartesian space.
This. After mulling it over, this helps me to see your POV, from which you are not wrong. But still, it seems to me that something is not quite right, because:

1. A Line Shape does not specify a length (or height), but rather a specific ending point,
2. the meter ends at (x,99),
3. if the user tells the Line Shape to end at (x,99), then it should end there (i.e. at the same place where the meter ends), rather than one pixel above, should it not?

What I am saying, is that the Line Shape does not end where the user tells it to! Semantics? I don't think so. Answer? I'm not sure; I leave that up to you gurus. :confused:
User avatar
jsmorley
Developer
Posts: 19543
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

jsmorley » January 14th, 2019, 2:37 pm

I believe that the way shapes work in a vector world is that the defined measurements are "from, up to", not "from, through" the defined points.

If we look at this code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeterShape1]
Meter=Shape
X=2
Shape=Line 0,0,0,100 | StrokeWidth 4 | Stroke Color 255,255,255,190

[MeterShape2]
Meter=Shape
X=2
Shape=Line 0,100,0,200 | StrokeWidth 4 | Stroke Color 0,255,0,190

[MeterShape3]
Meter=Shape
X=2
Shape=Rectangle 2,0,50,100 | StrokeWidth 0 | Fill Color 0,255,255,190

[MeterShape4]
Meter=Shape
X=2
Shape=Rectangle 2,100,50,100 | StrokeWidth 0 | Fill Color 255,255,0,190
That gives us:
1.jpg
The Line(s) are defined as starting at 0 and ending at 100. the Rectangles are defined as starting at 0 and with a height of 100. Those should logically have the same result. They do...

Now if the definition of MeterShape1 from 0 to 100 in height, was 0 (inclusive) through 100 (inclusive), then the height of the line would be 101, not 100, and the next meter, MeterShape2, which starts at 100, would overlap the first one by one pixel. It does not as you can see.

If I look at the result in Photoshop, and measure the resulting size(s) of the elements created, they are all 100px in height.
2.jpg

So a line defined as starting at 0 and ending at 100 would drawn on the zero'th pixel through the 99th pixel. It would be 100 pixels tall, and a subsequent meter starting at 100 would abut it. They would share a common "boundary". I think this would be next to impossible to wrap your head around if it were otherwise.
You do not have the required permissions to view the files attached to this post.
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Thread for help with the new Shape meter

Yincognito » January 14th, 2019, 6:32 pm

jsmorley wrote:
January 14th, 2019, 2:37 pm
I believe that the way shapes work in a vector world is that the defined measurements are "from, up to", not "from, through" the defined points. So a line defined as starting at 0 and ending at 100 would drawn on the zero'th pixel through the 99th pixel. It would be 100 pixels tall, and a subsequent meter starting at 100 would abut it. They would share a common "boundary". I think this would be next to impossible to wrap your head around if it were otherwise.
The first sentence is the best explanation - it made things clear for me, after you put it that way. However, I wanted to test if these shapes are consistent with other types of meters (e.g. String), and they are. But one thing that popped into my brain while I was testing the above was the 0r / 0R system of displaying meters one after another in the Rainmeter skins - and then I realized that everything else follows the same principle (i.e. 0 to n-1, for an extent of n pixels), and the best example is the 0r / 0R system, where "next" pixel is actually the 0th after, not the 1st after. If I think about it, this is also consistent not only all through Rainmeter, but also with Photoshop, where lines start at the 0th pixel and end at the (n-1)th. That settles the whole thing for me - but for some reason it only came to my mind now. (the stir is over, sadly... :rosegift: )

Let's see what qwerky has to say though.
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Thread for help with the new Shape meter

qwerky » January 14th, 2019, 8:29 pm

Thanks for sticking with me on this.
jsmorley wrote:
January 14th, 2019, 2:37 pm
I believe that the way shapes work in a vector world is that the defined measurements are "from, up to", not "from, through" the defined points.
Since I have no experience with vector graphics, I accept your explanation above, as far as the way that vector graphics should work. Now on to how Rainmeter works... :Whistle
If we look at this code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeterShape1]
Meter=Shape
X=2
Shape=Line 0,0,0,100 | StrokeWidth 4 | Stroke Color 255,255,255,190

[MeterShape2]
Meter=Shape
X=2
Shape=Line 0,100,0,200 | StrokeWidth 4 | Stroke Color 0,255,0,190

[MeterShape3]
Meter=Shape
X=2
Shape=Rectangle 2,0,50,100 | StrokeWidth 0 | Fill Color 0,255,255,190

[MeterShape4]
Meter=Shape
X=2
Shape=Rectangle 2,100,50,100 | StrokeWidth 0 | Fill Color 255,255,0,190
That gives us:
1.jpg

The Line(s) are defined as starting at 0 and ending at 100. the Rectangles are defined as starting at 0 and with a height of 100. Those should logically have the same result. They do...
Sadly, here our thoughts diverge. As you said, the rectangles have a height of 100 (pixels), therefore they end at 99, because they are specified to start at 0; from 0 to 99 is 100 pixels, just as from 1 to 100 is 100 pixels, and that's the way one would expect 'height' to work.

The lines also end at 99, but they are specified to end at 100! Back to an earlier example of a line from y=1 to y=2. The question is not how long the line is (one thinks it is two pixels long, from a Photoshop POV, another thinks it is one pixel long from a vector POV), but where it ends! The user specified the line to end at 2, yet on the screen, the line shape would actually end at 1. The documentation for Shape Meter Line option clearly specifies "EndY (required): Y coordinate of the ending point of the line."

Now I'm rather a neophyte with Rainmeter, so I'll ask: is there another type of meter that specifies starting and ending points, as opposed to width/height? If so, does that meter cause the object drawn to end on the screen at the specified ending point, or one pixel before it?
Yincognito wrote:
January 14th, 2019, 6:32 pm
But one thing that popped into my brain while I was testing the above was the 0r / 0R system of displaying meters one after another in the Rainmeter skins
This is a good question. If a Shape Line meter (say 0,0,100,0 with strokewidth 4, for example) is followed by another meter with a relative xR, must x be zero, or one, in order for the next meter to abut, but not overlap, the previous Line meter? And, when it does abut, does it begin at x=99 or x=100? I have tried, but could not get the relative option to work, following a Line meter, and didn't want to spend too much time.