1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Merge pull request #104190 from KoBeWi/edit_your_limits

Add a dedicated editor for Camera2D limits
This commit is contained in:
Rémi Verschelde
2025-06-13 01:30:14 +02:00
6 changed files with 237 additions and 176 deletions

View File

@@ -2802,6 +2802,11 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
}
void CanvasItemEditor::_update_cursor() {
if (cursor_shape_override != CURSOR_ARROW) {
set_default_cursor_shape(cursor_shape_override);
return;
}
// Choose the correct default cursor.
CursorShape c = CURSOR_ARROW;
switch (tool) {
@@ -2865,6 +2870,14 @@ void CanvasItemEditor::_update_lock_and_group_button() {
ungroup_button->set_disabled(!has_canvas_item);
}
void CanvasItemEditor::set_cursor_shape_override(CursorShape p_shape) {
if (cursor_shape_override == p_shape) {
return;
}
cursor_shape_override = p_shape;
_update_cursor();
}
Control::CursorShape CanvasItemEditor::get_cursor_shape(const Point2 &p_pos) const {
// Compute an eventual rotation of the cursor
const CursorShape rotation_array[4] = { CURSOR_HSIZE, CURSOR_BDIAGSIZE, CURSOR_VSIZE, CURSOR_FDIAGSIZE };