Gdevelop: Selection box is not rotated when an object is rotated

Created on 8 May 2020  Â·  8Comments  Â·  Source: 4ian/GDevelop

https://streamable.com/uqyxl7

This is the minor issue in action,if you drag a sprite in the editor the selection box will correctly expand,but the moment you change its angle the box dosent update properly,you can test this with any example project

👌good first issue 😤Non optimal UI behavior

Most helpful comment

Selection rectangles displayed around objects are rendered in https://github.com/4ian/GDevelop/blob/master/newIDE/app/src/InstancesEditor/SelectedInstances.js#L39

Position of the rectangle of an instance is computed using an instance measurer: https://github.com/4ian/GDevelop/blob/c000a735bb45d4f5db8007b27954172e6e5f1095/newIDE/app/src/InstancesEditor/InstancesRenderer/index.js#L33-L75

An instance here is a gd.InitialInstance, so all its methods here, including the one to get the angle:
https://github.com/4ian/GDevelop/blob/c000a735bb45d4f5db8007b27954172e6e5f1095/GDevelop.js/Bindings/Bindings.idl#L731-L741

The goal is to render the selection rectangles rotated like the instance is.

All 8 comments

"I guess the "box" is a pixi object, just synchronize its angle with the object's properties". as advised by @arthuro555. I am not really acquainted with Pixi, so I would like to give this issue a try because I might learn a thing or two about Pixi JS in the process. if no one is interested, can I be guided to the relevant code?

I guess the relevant code should be in the files src/InstancesEditor/SelectionRectangle.js and src/InstancesEditor/InstancesRotator :)

Thanks @arthuro555 I'll just have a look at it.

Selection rectangles displayed around objects are rendered in https://github.com/4ian/GDevelop/blob/master/newIDE/app/src/InstancesEditor/SelectedInstances.js#L39

Position of the rectangle of an instance is computed using an instance measurer: https://github.com/4ian/GDevelop/blob/c000a735bb45d4f5db8007b27954172e6e5f1095/newIDE/app/src/InstancesEditor/InstancesRenderer/index.js#L33-L75

An instance here is a gd.InitialInstance, so all its methods here, including the one to get the angle:
https://github.com/4ian/GDevelop/blob/c000a735bb45d4f5db8007b27954172e6e5f1095/GDevelop.js/Bindings/Bindings.idl#L731-L741

The goal is to render the selection rectangles rotated like the instance is.

If anyone else is interested in issuing a PR; I am not very confident whether I'll be able to derive a fix soon so pls go ahead :)

@4ian in the previous update ,it was suggested to change rotate selection box as the instance is being rotated but there are two rectangles instancerect and the selection rectangle does the instance rectangle need to be rotated too ??

moreover when we rotate selection rectangle like instance the resize and rotate button need to be rotated as well ??

Screenshot from 2020-10-09 17-30-22

Screenshot of rotated selection rectangle and the resize and rotate buttons

Yes all Gizmo should be rotated with it.

Le ven. 9 oct. 2020 à 14:08, VolDemorT-acer notifications@github.com a
écrit :

@4ian https://github.com/4ian in the previous update ,it was suggested
to change rotate selection box as the instance is being rotated but there
are two rectangles instancerect and the selection rectangle does the
instance rectangle need to be rotated too ??

moreover when we rotate selection rectangle like instance the resize and
rotate button need to be rotated as well ??

[image: Screenshot from 2020-10-09 17-30-22]
https://user-images.githubusercontent.com/58597818/95581084-04dd2880-0a56-11eb-98be-2bd5a7c28c6d.png

Screenshot of rotated selection rectangle and the resize and rotate buttons

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/4ian/GDevelop/issues/1741#issuecomment-706142918, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAMX4DVB5DMU7KCWM3ALGXDSJ34LJANCNFSM4M33EKSQ
.

2017

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Phenomena3 picture Phenomena3  Â·  5Comments

ced64k picture ced64k  Â·  4Comments

Bouh picture Bouh  Â·  4Comments

Jeje2201 picture Jeje2201  Â·  5Comments

RyanNerd picture RyanNerd  Â·  4Comments