1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Allow for easier editing of rect CollisionShape2D

This commit is contained in:
Tomasz Chabora
2020-04-10 14:04:08 +02:00
committed by kobewi
parent ff8a1fdc19
commit 79fea30cd2
2 changed files with 55 additions and 17 deletions

View File

@@ -52,6 +52,17 @@ class CollisionShape2DEditor : public Control {
SEGMENT_SHAPE
};
const Point2 RECT_HANDLES[8] = {
Point2(1, 0),
Point2(1, 1),
Point2(0, 1),
Point2(-1, 1),
Point2(-1, 0),
Point2(-1, -1),
Point2(0, -1),
Point2(1, -1),
};
EditorNode *editor;
UndoRedo *undo_redo;
CanvasItemEditor *canvas_item_editor;
@@ -63,6 +74,8 @@ class CollisionShape2DEditor : public Control {
int edit_handle;
bool pressed;
Variant original;
Transform2D original_transform;
Point2 last_point;
Variant get_handle_value(int idx) const;
void set_handle(int idx, Point2 &p_point);