You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need draw_background() to paint something within the CanvasItem clipping area and draw_stuff() to draw everything else within some margin. Such thing would be possible if calls to canvas_item_set_clip() and canvas_item_set_custom_rect() were cached.
The text was updated successfully, but these errors were encountered:
The issue as I understand it is as follows: we want to clip drawing to some area A, and draw some things X, then clip it to some area B, and draw some other things Y. The draw commands are queued up to be drawn but the clip setting commands are performed immediately(?); the result is that both X and Y are drawn clipped to area B (the last clip we set).
Tested in 2.1.4, 3.0, 3.2.3.rc3
Can reproduce issue in all
Tested with a control with this script:
extendsControlfunc_notification(what):
ifwhat==NOTIFICATION_DRAW:
# Enable clippingVisualServer.canvas_item_set_clip(get_canvas_item(), true)
# clip to size area Aiftrue:
VisualServer.canvas_item_set_custom_rect(get_canvas_item(), true,
Rect2(Vector2(0, 0), Vector2(128, 128)));
# draw some Xdraw_circle(get_local_mouse_position(), 128, Color(0,1,0,1))
# clip to size area Biftrue:
VisualServer.canvas_item_set_custom_rect(get_canvas_item(), true,
Rect2(Vector2(32, 32), Vector2(64, 64)));
# draw some Ydraw_circle(get_local_mouse_position(), 80, Color(1,0,0,1))
func_physics_process(delta):
update()
Expected (left): a large green circle clipped by a large square area, and a small red circle clipped by a smaller square area. (Both circles are drawn at the mouse position.)
Result (right): large green circle and small red circle both clipped by the smaller square area.
For instance in this snipped of code:
I need
draw_background()
to paint something within the CanvasItem clipping area anddraw_stuff()
to draw everything else within some margin. Such thing would be possible if calls tocanvas_item_set_clip()
andcanvas_item_set_custom_rect()
were cached.The text was updated successfully, but these errors were encountered: