It is currently November 15th, 2018, 3:36 pm

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

Report bugs with the Rainmeter application and suggest features.
User avatar
ikarus1969
Posts: 287
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

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

ikarus1969 » November 6th, 2017, 2:48 pm

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?
You do not have the required permissions to view the files attached to this post.
Last edited by ikarus1969 on November 6th, 2017, 5:23 pm, edited 1 time in total.
User avatar
Brian
Developer
Posts: 1789
Joined: November 24th, 2011, 1:42 am
Location: Ohio

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

Brian » November 6th, 2017, 3:28 pm

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
User avatar
ikarus1969
Posts: 287
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

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

ikarus1969 » November 6th, 2017, 5:23 pm

Ah, ok, thank you Brian for clarifying!