Page 1 of 1

Bug? Shape Rectangle with "radius 0" differs from "no radius defined"

Posted: November 6th, 2017, 2:48 pm
by ikarus1969
Hi!

today i noticed a difference between the following definitions:

I have a rectangle, one time defined with no radius and one time with radius 0 and got a difference which i didn't expect:

Here, radius is defined as zero:

Code: Select all

[RM_Rect]
Meter=SHAPE
Shape=Rectangle 20, 20, 100, 100, 0, 0 | StrokeWidth 10 | Stroke Color 000000FF | Fill Color 004080FF
-> will produce a rounded corner:
Screenshot Rainmeter Shape Radius 0.jpg

Here, radius is not defined:

Code: Select all

[RM_Rect]
Meter=SHAPE
Shape=Rectangle 20, 20, 100, 100 | StrokeWidth 10 | Stroke Color 000000FF | Fill Color 004080FF
-> will produce a "sharp" corner:
Screenshot Rainmeter Shape No Radius.jpg
Is this an intended behavior?
Or shouldn't both code fragments produce the same, second ("sharp"), corner-type?

Re: Bug? Shape Rectangle with "radius 0" differs from "no radius defined"

Posted: November 6th, 2017, 3:28 pm
by Brian
Unfortunately this is expected behavior from D2D. It has to do with how the stroke is drawn.

Here is what MS says: [link]
Microsoft wrote:Even when both radiuX and radiusY are zero, the rounded rectangle is different from a rectangle., When stroked, the corners of the rounded rectangle are roundly joined, not mitered (square).
-Brian

Re: Bug? Shape Rectangle with "radius 0" differs from "no radius defined"

Posted: November 6th, 2017, 5:23 pm
by ikarus1969
Ah, ok, thank you Brian for clarifying!