godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix immediate mesh modifications that don't call set_mesh

Open tdaven opened this issue 1 year ago • 3 comments

Mesh_instance_2d has no way to know when the mesh had been modified unless you called set_mesh. This meant that you could modify the underlying mesh without it knowing which could result in incorrect result.

Modified mesh_instance_2d to be more similar to mesh_instance_3d which connects to the changed signal of the mesh and reacts occordingly.

Resolves 94151

tdaven avatar Oct 03 '24 14:10 tdaven

I've investigated this much deeper and in the cases when it disappears, its getting skipped in _attach_canvas_item_for_draw because p_clip_rect.intersects(p_global_rect, true) returns no intersection. The values for p_clip_rect look fine but p_global_rect has a position that looks suspect. Still working on why it is wrong though.

tdaven avatar Oct 05 '24 17:10 tdaven

I've investigated this much deeper and in the cases when it disappears, its getting skipped in _attach_canvas_item_for_draw because p_clip_rect.intersects(p_global_rect, true) returns no intersection. The values for p_clip_rect look fine but p_global_rect has a position that looks suspect. Still working on why it is wrong though.

I suspect the bounding rect isn't updated if we don't queue a redraw

clayjohn avatar Oct 05 '24 22:10 clayjohn

I've investigated this much deeper and in the cases when it disappears, its getting skipped in _attach_canvas_item_for_draw because p_clip_rect.intersects(p_global_rect, true) returns no intersection. The values for p_clip_rect look fine but p_global_rect has a position that looks suspect. Still working on why it is wrong though.

I suspect the bounding rect isn't updated if we don't queue a redraw

Yup. That is what happens.

tdaven avatar Oct 05 '24 22:10 tdaven

Thanks!

Repiteo avatar Oct 14 '24 19:10 Repiteo