conrod
conrod copied to clipboard
Source rectangle miscommunication in conrod_piston
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.
Hey @bvssvni, is this something you should look at?