Merge pull request #8326 from Hinsbart/particle_flip
Particles2D: Fix flip property (again).
This commit is contained in:
commit
fb4e9962ea
@ -583,13 +583,13 @@ void Particles2D::_notification(int p_what) {
|
|||||||
src_rect.pos.x = size.x * (frame % h_frames);
|
src_rect.pos.x = size.x * (frame % h_frames);
|
||||||
src_rect.pos.y = size.y * (frame / h_frames);
|
src_rect.pos.y = size.y * (frame / h_frames);
|
||||||
}
|
}
|
||||||
|
Rect2 dst_rect(Point2(), size);
|
||||||
if (flip_h)
|
if (flip_h)
|
||||||
src_rect.size.x = -src_rect.size.x;
|
dst_rect.size.x = -dst_rect.size.x;
|
||||||
if (flip_v)
|
if (flip_v)
|
||||||
src_rect.size.y = -src_rect.size.y;
|
dst_rect.size.y = -dst_rect.size.y;
|
||||||
|
|
||||||
texture->draw_rect_region(ci, Rect2(Point2(), size), src_rect, color);
|
texture->draw_rect_region(ci, dst_rect, src_rect, color);
|
||||||
//VisualServer::get_singleton()->canvas_item_add_texture_rect(ci,r,texrid,false,color);
|
//VisualServer::get_singleton()->canvas_item_add_texture_rect(ci,r,texrid,false,color);
|
||||||
} else {
|
} else {
|
||||||
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(), size), color);
|
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(), size), color);
|
||||||
|
Loading…
Reference in New Issue
Block a user