conrod icon indicating copy to clipboard operation
conrod copied to clipboard

Source rectangle miscommunication in conrod_piston

Open hayashi-stl opened this issue 4 years ago • 1 comments

When the source rectangle for an image is obtained in conrod_piston::draw::primitive, the code looks like this:

let (x, y, w, h) = source_rect.x_y_w_h();
image.source_rectangle = Some([x, y, w, h]);

conrod_core::Rect::x_y_w_h returns the x and y position of the center of the rectangle, but image.source_rectangle is of type graphics::types::SourceRectangle, which is in the [x, y, w, h] format, but where x and y represent the position of the top-left corner.

I understand that fixing this miscommunication is breaking, but it would be nice to at least document this.

hayashi-stl avatar Jun 20 '20 23:06 hayashi-stl

Hey @bvssvni, is this something you should look at?

alvinhochun avatar Aug 25 '20 10:08 alvinhochun