mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #13173 from poke1024/fixicons
Add polygon 2d editor handle icons
This commit is contained in:
commit
d992eb1b25
5
editor/icons/icon_editor_handle_add.svg
Normal file
5
editor/icons/icon_editor_handle_add.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="10" height="10" version="1.1" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="5" cy="5" r="5" fill-opacity=".29412"/>
|
||||
<circle cx="5" cy="5" r="4" fill="#474747"/>
|
||||
<path d="m4 2v2h-2v2h2v2h2v-2h2v-2h-2v-2z" fill="#84ffb1"/>
|
||||
</svg>
|
After Width: | Height: | Size: 265 B |
@ -497,8 +497,7 @@ void AbstractPolygon2DEditor::forward_draw_over_viewport(Control *p_overlay) {
|
||||
Control *vpc = canvas_item_editor->get_viewport_control();
|
||||
|
||||
Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
|
||||
Ref<Texture> default_handle = get_icon("EditorHandle", "EditorIcons");
|
||||
Ref<Texture> selected_handle = get_icon("EditorHandleSelected", "EditorIcons");
|
||||
const Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons");
|
||||
|
||||
const Vertex active_point = get_active_point();
|
||||
const int n_polygons = _get_polygon_count();
|
||||
@ -572,8 +571,8 @@ void AbstractPolygon2DEditor::forward_draw_over_viewport(Control *p_overlay) {
|
||||
const Vector2 p = (vertex == edited_point) ? edited_point.pos : (points[i] + offset);
|
||||
const Vector2 point = xform.xform(p);
|
||||
|
||||
Ref<Texture> handle = vertex == active_point ? selected_handle : default_handle;
|
||||
vpc->draw_texture(handle, point - handle->get_size() * 0.5);
|
||||
const Color modulate = vertex == active_point ? Color(0.5, 1, 2) : Color(1, 1, 1);
|
||||
vpc->draw_texture(handle, point - handle->get_size() * 0.5, modulate);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user