Re: Thread for help with the new Shape meter
Posted: January 12th, 2019, 1:15 am
Okay. Sorry to have caused such a stir. Now that we have an answer, we will know how to deal with it.
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!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...
Blame it on me. I like stirs ...
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 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!
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 ...
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.
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:
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
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... )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.
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...
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.If we look at this code:
That gives us: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
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...
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.Yincognito wrote: ↑January 14th, 2019, 6:32 pmBut 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