egui icon indicating copy to clipboard operation
egui copied to clipboard

Impls From<Pos2> for Vec2, From<Vec2> for Pos2

Open fundon opened this issue 3 years ago • 2 comments

Impls From<Pos2> for Vec2, From<Vec2> for Pos2.

fundon avatar Dec 18 '22 08:12 fundon

There are a lot of interfaces that take impl Into<Vec2> as argument. With this PR, it would be very easy to accidentally pass a position in these places.

emilk avatar Dec 19 '22 09:12 emilk

https://github.com/search?q=repo%3Aemilk%2Fegui%20Into%3CPos2%3E&type=code

Before I was trying to modify the windows position, default_pos and current_pos accept the Into<Pos2> parameter, which would be more convenient if Vec2 implemented From trait.

fundon avatar Dec 20 '22 12:12 fundon

@fundon why would it be more convenient? You can use pos2(x,y) or [x,y] and it will work fine.

emilk avatar Jan 23 '23 07:01 emilk

Ok, we can add it if needed in the future. :)

fundon avatar Jan 24 '23 07:01 fundon