It is currently March 29th, 2024, 1:36 pm

[Bug] Shape: difference in position before / after combining

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

[Bug] Shape: difference in position before / after combining

Post by ikarus1969 »

Good morning guys!

I have a problem using a shape consisting of triangles which i first want to rotate and then combine them to a new shape.

before combining, the single triangles look good and in the correct position. After combining them, the first shape is moved a certain amount of pixels (along its original x-axis?).

In the following screenshot you can see the single triangles and after that a screenshot after combinging them with the "Union" operator - can someone either direct me to a correct coding or confirm that this is a bug please?

Edit: Configuration added:
Rainmeter 4.3.0.3253 beta (64-bit)
Language: German (1031)
Build time: 2018-09-28 8:12:23
Commit Hash: 442ae103
Windows 7 Professional 64-bit (build 7601) Service Pack 1 - German (3079)
Edit: graphics adapter added:
AMD Radeon HD 8670D
Screenshot RM #1 - before combining.jpg
Screenshot RM #2 - after combining.jpg

Code: Select all

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

[Variables]
ELLIPSE_ORIGIN.X=200
ELLIPSE_ORIGIN.Y=200

ELLIPSE_WIDTH=100
ELLIPSE_HEIGHT=160

[Meter_Test]
Meter=SHAPE
Shape= Path Path_Triangle | Rotate 330, (0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_HEIGHT#
Shape2=Path Path_Triangle | Rotate 240, (0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_HEIGHT#
; Shape3=Combine Shape | Union Shape2

Path_Triangle=(#ELLIPSE_ORIGIN.X# - 0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_ORIGIN.Y# | LineTo #ELLIPSE_ORIGIN.X#, (#ELLIPSE_ORIGIN.Y# - #ELLIPSE_HEIGHT#) | LineTo (#ELLIPSE_ORIGIN.X# + 0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_ORIGIN.Y# | ClosePath 1

SolidColor=FFFFFFFF
AntiAlias=1
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
Last edited by ikarus1969 on January 8th, 2019, 9:43 am, edited 1 time in total.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Bug] Shape: difference in position before / after combining

Post by oZone »

I think it's bug. Parent shape will ignore anchors when you use rotate with non-zero degrees of angle.

Shape (red triangle) is same as Shape2 (parent shape, blue triangle, but hidden because of Shape5).
Shape3 is child shape (blue triangle) and Shape 4 is union.
Shape5 (black triangle) is same as Shape only without anchors.

if you scroll up/down it will increase/decrease degrees of angle for rotation.
Shape2 should be in same position as Shape but it's in position with Shape5.


Code: Select all

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

[Variables]
ELLIPSE_ORIGIN.X=200
ELLIPSE_ORIGIN.Y=200

ELLIPSE_WIDTH=100
ELLIPSE_HEIGHT=160

ROTATION=0

[Meter_test]
Meter=SHAPE
Shape= Path Path_Triangle | Rotate #ROTATION#, (0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_HEIGHT# | Fill Color 255,0,0,100
Shape2= Path Path_Triangle | Rotate #ROTATION# , (0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_HEIGHT# | Fill Color 0,0,255,100
Shape3=Path Path_Triangle | Rotate 240, (0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_HEIGHT#
Shape4=Combine Shape2 | Union Shape3
Shape5= Path Path_Triangle | Rotate #ROTATION# | Fill Color 0,0,0,255

Path_Triangle=(#ELLIPSE_ORIGIN.X# - 0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_ORIGIN.Y# | LineTo #ELLIPSE_ORIGIN.X#, (#ELLIPSE_ORIGIN.Y# - #ELLIPSE_HEIGHT#) | LineTo (#ELLIPSE_ORIGIN.X# + 0.5 * #ELLIPSE_WIDTH#), #ELLIPSE_ORIGIN.Y# | ClosePath 1

MouseScrollDownAction=[!SetVariable ROTATION (#ROTATION#-10)]
MouseScrollUpAction=[!SetVariable ROTATION (#ROTATION#+10)]
LeftMouseDownAction=[!SetVariable ROTATION 0]
SolidColor=FFFFFFFF
AntiAlias=1
DynamicVariables=1

[Meter_text]
Meter=String
X=(#ELLIPSE_WIDTH#/2)
Y=(#ELLIPSE_HEIGHT#/4)
FontSize=20
Text=[#ROTATION]
DynamicVariables=1
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [Bug] Shape: difference in position before / after combining

Post by ikarus1969 »

Maybe there's some spare time to have a look at this bug/behavior? After bringing the container-feature to life and the 2-month period please someone notice that? Thank you!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug] Shape: difference in position before / after combining

Post by jsmorley »

ikarus1969 wrote: December 4th, 2018, 7:14 am Maybe there's some spare time to have a look at this bug/behavior? After bringing the container-feature to life and the 2-month period please someone notice that? Thank you!
It's on the radar! :-)
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [Bug] Shape: difference in position before / after combining

Post by ikarus1969 »

thanks so much. . :bow:
User avatar
Brian
Developer
Posts: 2674
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug] Shape: difference in position before / after combining

Post by Brian »

This has been fixed for the next beta. Thanks for reporting.

[Technical_Details]
When a shape is combined with another shape, some of the modifiers get "cloned" to a newly created shape. In this case, a "rotation defined" flag was not being copied properly so the proper rotation anchors were not being used.
[\Technical_Details]

-Brian
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [Bug] Shape: difference in position before / after combining

Post by ikarus1969 »

Thanks for fixing this!