Jump to content

Canvas2D MarginAlignment Bug


MasterK
 Share

Recommended Posts

Ok, basically: it's either you use absolute positioning through the position property (or the x/y properties which are shortcut) of your primitive or you rely on positioning and you should not set a position: the position will be computed by the positioning engine and the result will be stored in the actualPosition property.

In this doc this is what I try to say by:

Quote

Alignment: a primitive can use only a portion of the Layout Area it's assigned to. To help define how it should be positioned into this Area you can rely on Absolute Positioning (defined by the position property of the primitive) or on Alignment using the marginAlignment property

You have to rely on the margin property to create the offset you need, I've changed your PG to illustrate it: http://www.babylonjs-playground.com/#1CCIMC#6

The fact that setting x/y/position change the final result is what I would call an "unexpected behavior" ;)

I need to improve the documentation I mentioned above to clarify this.

Link to comment
Share on other sites

6 hours ago, Nockawa said:

Ok, basically: it's either you use absolute positioning through the position property (or the x/y properties which are shortcut) of your primitive or you rely on positioning and you should not set a position: the position will be computed by the positioning engine and the result will be stored in the actualPosition property.

In this doc this is what I try to say by:

You have to rely on the margin property to create the offset you need, I've changed your PG to illustrate it: http://www.babylonjs-playground.com/#1CCIMC#6

The fact that setting x/y/position change the final result is what I would call an "unexpected behavior" ;)

I need to improve the documentation I mentioned above to clarify this.

OK.... I accept that.... 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...