-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
approvedA feature that has been approvedA feature that has been approvedfeatNew feature or requestNew feature or request
Description
Summary
Methods that take separate x: f32, y: f32 parameters should accept impl Into<Vector2> instead and there should be From implementations for (f32, f32), and macroquad's Vec2.
Motivation
Builder methods like .offset(x, y) and .pivot(x, y) take two separate floats. This means you can't pass a Vec2 directly, you have to destructure it: .offset(pos.x, pos.y).
With impl Into<Vector2>, you pass whatever you have.
Proposed API
el.floating(|f| f.offset((10.0, 20.0)));
el.rotation(|r| r.pivot((0.5, 0.5)));
let pos = Vec2::new(10.0, 20.0);
el.floating(|f| f.offset(pos));Behavior
.offset(10.0, 20.0)won't compile anymore. (Breaking change)- The prelude remains unchanged
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
approvedA feature that has been approvedA feature that has been approvedfeatNew feature or requestNew feature or request