It is currently September 26th, 2020, 6:41 pm

Thread for help with the Shape meter

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

Re: Thread for help with the new Shape meter

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?
Sorry for being so obtuse. What I am trying to say is this: the skin and the background meter start at 100,100, and are 100x100 in size; therefore they end at 199,199. So a two-pixel wide line that goes from 120,100 to 121,199, should end at the very bottom of the skin/meter, should it not? But in the example:

Code: Select all

``````Meter=Shape
Shape=Line 20,0,20,99 | Extend DividerModifiers
Shape=Line 20,0,20,100 | Extend DividerModifiers
DividerModifiers=StrokeWidth 2 | Stroke Color #colorDivider#
AntiAlias=1
X=100
Y=100
W=100
H=100
``````
the line which extends from 20,0 to 21,99 of the shape meter (or 120,100 to 121,199 of the skin, since the shape meter begins at 100,100 of the skin), one expects to end at the bottom of the skin/meter, but it is actually one pixel short; whereas the line which extends from 20,0 to 21,100 of the shape meter (or 120,100 to 121,200 of the skin) does reach the bottom, but the point 121,200 is actually outside the skin/background meter.
Yincognito
Posts: 2629
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

jsmorley wrote: January 12th, 2019, 12:26 am 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".
And there you have it. The explanation for this behavior, I mean.
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

But yeah, StrokeWidth is a factor, even with Line shapes. If you have a line that goes from 0 to 0, the larger the StrokeWidth, the "taller" the meter container is, but the actual line is never drawn, no matter how big or small you make the StrokeWidth.
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am

Re: Thread for help with the new Shape meter

jsmorley wrote: January 12th, 2019, 12:26 am 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".
Agreed. So a line that starts at 0 and ends at 1 has a height of 2, one that starts at 0 and ends at 2 has a height of 3, and one that starts at 0 and ends at 99 has a height of 100. That's what my logic tells me, so I don't quite understand why that isn't what happens in practice.
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

qwerky wrote: January 12th, 2019, 12:38 am Agreed. So a line that starts at 0 and ends at 1 has a height of 2, one that starts at 0 and ends at 2 has a height of 3, and one that starts at 0 and ends at 99 has a height of 100. That's what my logic tells me, so I don't quite understand why that isn't what happens in practice.
Not entirely sure I can wrap my head around it. It has to do with the fact that a "shape" like a Rectangle or Ellipse is defined by the boundaries of the shape, and any "stroke" is drawn directly "on" that boundary, and will be 1/2 inside and 1/2 outside. A Line meter on the other hand is entirely "stroke", and has no "inside" or "outside".
Yincognito
Posts: 2629
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

qwerky wrote: January 12th, 2019, 12:38 am Agreed. So a line that starts at 0 and ends at 1 has a height of 2, one that starts at 0 and ends at 2 has a height of 3, and one that starts at 0 and ends at 99 has a height of 100. That's what my logic tells me, so I don't quite understand why that isn't what happens in practice.
It might be because it's more human friendly. I mean, if this wouldn't behave as it does, skin developers would always have to be careful to subtract 1 from the ending point of lines, in order to have something of the same extent as other things that are defined by the width/height and not start and end points. This is a common thing in programming, where you always have to be careful to make a for loop from 0 to 99 if you want to have it run 100 times...
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am

Re: Thread for help with the new Shape meter

Yincognito wrote: January 12th, 2019, 12:44 am This is a common thing in programming, where you always have to be careful to make a for loop from 0 to 99 if you want to have it run 100 times...
Thanks, that's a good example. A loop from 0 to 99 gives 100 iterations, not 99.
jsmorley wrote: January 12th, 2019, 12:42 am Not entirely sure I can wrap my head around it. It has to do with the fact that a "shape" like a Rectangle or Ellipse is defined by the boundaries of the shape, and any "stroke" is drawn directly "on" that boundary, and will be 1/2 inside and 1/2 outside. A Line meter on the other hand is entirely "stroke", and has no "inside" or "outside".
If you have a line that goes from y=1 to y=2, how tall is it? I think it is two pixels tall, but I think you think it is one pixel tall (not sure why, perhaps because it only moved one pixel)? If you paint it in Photoshop, it will be two pixels tall. However, I have no knowledge of vector graphics, so don't know what should be expected there.
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

I just think perhaps the "zero'th" pixel is not drawn. It effects the size of the meter container, as in a loop 0-99 is 100 as has been stated, but if you draw a line from 0 to 0 or 110 to 110, that is logically a "singularity" in the realm of Cartesian space, which is a different viewpoint than a a loop.

I think the comment that you see a line from 1 to 2 as one pixel in height due to the concept of the line "drawing" in space by one pixel is probably on the mark.
Yincognito
Posts: 2629
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

jsmorley wrote: January 12th, 2019, 12:56 am I just think perhaps the "zero'th" pixel is not drawn. It effects the size of the meter container, as in a loop 0-99 is 100 as has been stated, but if you draw a line from 0 to 0 or 110 to 110, that is logically a "singularity" in the realm of Cartesian space, which is a different viewpoint than a a loop.
I was using the loop thing simply for comparison purposes. Glad we have a verdict though.
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Yincognito wrote: January 12th, 2019, 1:01 am I was using the loop thing simply for comparison purposes. Glad we have a verdict though.