summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-06-05 15:52:05 +0200
committerGitHub <noreply@github.com>2017-06-05 15:52:05 +0200
commitf8d7670e82007103573b88f48fe7b7c4addbd66d (patch)
treef4802061ca26ae9220ec9a5e9d51d80e1a465faa /editor
parent075c7d8133e4fde353ab54a255638b0c9a3740a5 (diff)
parenta3c90b029308eb46b7fd83a0cf7b502ecbd79d55 (diff)
Merge pull request #9038 from AlexHolly/rect2-rename-pos
renamed all Rect2.pos to Rect2.position
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_editor.cpp8
-rw-r--r--editor/editor_audio_buses.cpp2
-rw-r--r--editor/editor_fonts.cpp4
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_run.cpp12
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp80
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp8
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp18
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp74
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp98
-rw-r--r--editor/project_settings.cpp4
-rw-r--r--editor/property_editor.cpp30
-rw-r--r--editor/scene_tree_editor.cpp8
-rw-r--r--editor/script_editor_debugger.cpp10
15 files changed, 182 insertions, 182 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp
index ebfc0326d2..1798e66e8a 100644
--- a/editor/animation_editor.cpp
+++ b/editor/animation_editor.cpp
@@ -76,7 +76,7 @@ private:
Ref<StyleBox> sb = get_stylebox("normal", "LineEdit");
sb->draw(ci, r);
r.size -= sb->get_minimum_size();
- r.pos += sb->get_offset();
+ r.position += sb->get_offset();
//VisualServer::get_singleton()->canvas_item_add
Ref<Font> f = get_font("font", "Label");
@@ -111,7 +111,7 @@ private:
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, r.pos + Point2(iflp * r.size.width, prev * r.size.height), r.pos + Point2(ifl * r.size.width, h * r.size.height), mcolor);
+ VisualServer::get_singleton()->canvas_item_add_line(ci, r.position + Point2(iflp * r.size.width, prev * r.size.height), r.position + Point2(ifl * r.size.width, h * r.size.height), mcolor);
prev = h;
}
@@ -138,7 +138,7 @@ private:
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, r.pos + Point2(iflp * r.size.width, prev * r.size.height), r.pos + Point2(ifl * r.size.width, h * r.size.height), color);
+ VisualServer::get_singleton()->canvas_item_add_line(ci, r.position + Point2(iflp * r.size.width, prev * r.size.height), r.position + Point2(ifl * r.size.width, h * r.size.height), color);
prev = h;
}
}
@@ -2076,7 +2076,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
Rect2 area(ofs.x, ofs.y + ((int(mpos.y) / h) + 1) * h, name_limit, h);
track_name->set_text(animation->track_get_path(idx));
- track_name->set_position(te->get_global_position() + area.pos);
+ track_name->set_position(te->get_global_position() + area.position);
track_name->set_size(area.size);
track_name->show_modal();
track_name->grab_focus();
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 42adf3abcf..ef7007c7a6 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -342,7 +342,7 @@ void EditorAudioBus::_effect_edited() {
if (effect->get_metadata(0) == Variant()) {
Rect2 area = effects->get_item_rect(effect);
- effect_options->set_position(effects->get_global_position() + area.pos + Vector2(0, area.size.y));
+ effect_options->set_position(effects->get_global_position() + area.position + Vector2(0, area.size.y));
effect_options->popup();
//add effect
} else {
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index dc4c2b21bc..0873b90f22 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -49,8 +49,8 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
int chr = c[0];
Rect2 frect;
- frect.pos.x = c[1];
- frect.pos.y = c[2];
+ frect.position.x = c[1];
+ frect.position.y = c[2];
frect.size.x = c[3];
frect.size.y = c[4];
Point2 align(c[5], c[6] + p_valign);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 08cf5b2693..8b988c4b91 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3846,7 +3846,7 @@ void EditorNode::_dock_select_draw() {
unusable.a = 0.1;
Rect2 unr(s.x * 2, 0, s.x * 2, s.y * 2);
- unr.pos += Vector2(2, 5);
+ unr.position += Vector2(2, 5);
unr.size -= Vector2(4, 7);
dock_select->draw_rect(unr, unusable);
@@ -3899,7 +3899,7 @@ void EditorNode::_dock_select_draw() {
Rect2 r(ofs, s);
dock_select_rect[i] = r;
- r.pos += Vector2(2, 5);
+ r.position += Vector2(2, 5);
r.size -= Vector2(4, 7);
if (i == dock_select_rect_over) {
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index d2f841c3ee..c97dc9a88e 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -73,7 +73,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
}
Rect2 screen_rect;
- screen_rect.pos = OS::get_singleton()->get_screen_position(screen);
+ screen_rect.position = OS::get_singleton()->get_screen_position(screen);
screen_rect.size = OS::get_singleton()->get_screen_size(screen);
Size2 desired_size;
@@ -95,21 +95,21 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
case 0: { // default
args.push_back("-p");
- args.push_back(itos(screen_rect.pos.x) + "x" + itos(screen_rect.pos.y));
+ args.push_back(itos(screen_rect.position.x) + "x" + itos(screen_rect.position.y));
} break;
case 1: { // centered
- Vector2 pos = screen_rect.pos + ((screen_rect.size - desired_size) / 2).floor();
+ Vector2 pos = screen_rect.position + ((screen_rect.size - desired_size) / 2).floor();
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 2: { // custom pos
Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position");
- pos += screen_rect.pos;
+ pos += screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 3: { // force maximized
- Vector2 pos = screen_rect.pos;
+ Vector2 pos = screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
args.push_back("-mx");
@@ -117,7 +117,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
} break;
case 4: { // force fullscreen
- Vector2 pos = screen_rect.pos;
+ Vector2 pos = screen_rect.position;
args.push_back("-p");
args.push_back(itos(pos.x) + "x" + itos(pos.y));
args.push_back("-f");
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 3977519e94..d67832e10b 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -876,7 +876,7 @@ void AnimationTreeEditor::_draw_cos_line(const Vector2 &p_from, const Vector2 &p
static const int steps = 20;
Rect2 r;
- r.pos = p_from;
+ r.position = p_from;
r.expand_to(p_to);
Vector2 sign = Vector2((p_from.x < p_to.x) ? 1 : -1, (p_from.y < p_to.y) ? 1 : -1);
bool flip = sign.x * sign.y < 0;
@@ -888,7 +888,7 @@ void AnimationTreeEditor::_draw_cos_line(const Vector2 &p_from, const Vector2 &p
float c = -Math::cos(d * Math_PI) * 0.5 + 0.5;
if (flip)
c = 1.0 - c;
- Vector2 p = r.pos + Vector2(d * r.size.width, c * r.size.height);
+ Vector2 p = r.position + Vector2(d * r.size.width, c * r.size.height);
if (i > 0) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 3e6adfe27a..e6c08a9009 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -536,10 +536,10 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2 &p_rect, Node *p_n
Rect2 rect = c->get_item_rect();
Transform2D xform = p_parent_xform * p_canvas_xform * c->get_transform();
- if (p_rect.has_point(xform.xform(rect.pos)) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(rect.size.x, 0))) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(rect.size.x, rect.size.y))) &&
- p_rect.has_point(xform.xform(rect.pos + Vector2(0, rect.size.y)))) {
+ if (p_rect.has_point(xform.xform(rect.position)) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(rect.size.x, 0))) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(rect.size.x, rect.size.y))) &&
+ p_rect.has_point(xform.xform(rect.position + Vector2(0, rect.size.y)))) {
r_items->push_back(c);
}
@@ -652,7 +652,7 @@ void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE
// drag = transform.affine_inverse().basis_xform(p_dir); // zoom sensitive
drag = canvas_item->get_global_transform_with_canvas().affine_inverse().basis_xform(drag);
Rect2 local_rect = canvas_item->get_item_rect();
- local_rect.pos += drag;
+ local_rect.position += drag;
undo_redo->add_do_method(canvas_item, "edit_set_rect", local_rect);
} else { // p_move_mode==MOVE_LOCAL_BASE || p_move_mode==MOVE_LOCAL_WITH_ROT
@@ -680,7 +680,7 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
Vector2 tl = Point2(1e10, 1e10);
Rect2 r2;
- r2.pos = tl;
+ r2.position = tl;
List<Node *> &selection = editor_selection->get_selected_node_list();
@@ -695,13 +695,13 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
Rect2 rect = canvas_item->get_item_rect();
Transform2D xform = canvas_item->get_global_transform_with_canvas();
- r2.expand_to(xform.xform(rect.pos));
- r2.expand_to(xform.xform(rect.pos + Vector2(rect.size.x, 0)));
- r2.expand_to(xform.xform(rect.pos + rect.size));
- r2.expand_to(xform.xform(rect.pos + Vector2(0, rect.size.y)));
+ r2.expand_to(xform.xform(rect.position));
+ r2.expand_to(xform.xform(rect.position + Vector2(rect.size.x, 0)));
+ r2.expand_to(xform.xform(rect.position + rect.size));
+ r2.expand_to(xform.xform(rect.position + Vector2(0, rect.size.y)));
}
- return r2.pos;
+ return r2.position;
}
int CanvasItemEditor::get_item_count() {
@@ -759,18 +759,18 @@ CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D &
Vector2 endpoints[4] = {
- xform.xform(rect.pos),
- xform.xform(rect.pos + Vector2(rect.size.x, 0)),
- xform.xform(rect.pos + rect.size),
- xform.xform(rect.pos + Vector2(0, rect.size.y))
+ xform.xform(rect.position),
+ xform.xform(rect.position + Vector2(rect.size.x, 0)),
+ xform.xform(rect.position + rect.size),
+ xform.xform(rect.position + Vector2(0, rect.size.y))
};
Vector2 endpointsl[4] = {
- xforml.xform(rect.pos),
- xforml.xform(rect.pos + Vector2(rect.size.x, 0)),
- xforml.xform(rect.pos + rect.size),
- xforml.xform(rect.pos + Vector2(0, rect.size.y))
+ xforml.xform(rect.position),
+ xforml.xform(rect.position + Vector2(rect.size.x, 0)),
+ xforml.xform(rect.position + rect.size),
+ xforml.xform(rect.position + Vector2(0, rect.size.y))
};
DragType dragger[] = {
@@ -1552,8 +1552,8 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dfrom);
Rect2 local_rect = canvas_item->get_item_rect();
- Vector2 begin = local_rect.pos;
- Vector2 end = local_rect.pos + local_rect.size;
+ Vector2 begin = local_rect.position;
+ Vector2 end = local_rect.position + local_rect.size;
Vector2 minsize = canvas_item->edit_get_minimum_size();
if (uniform) {
@@ -1645,7 +1645,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (!dragging_bone) {
- local_rect.pos = begin;
+ local_rect.position = begin;
local_rect.size = end - begin;
canvas_item->edit_set_rect(local_rect);
@@ -1868,10 +1868,10 @@ void CanvasItemEditor::_viewport_draw() {
Vector2 endpoints[4] = {
- xform.xform(rect.pos),
- xform.xform(rect.pos + Vector2(rect.size.x, 0)),
- xform.xform(rect.pos + rect.size),
- xform.xform(rect.pos + Vector2(0, rect.size.y))
+ xform.xform(rect.position),
+ xform.xform(rect.position + Vector2(rect.size.x, 0)),
+ xform.xform(rect.position + rect.size),
+ xform.xform(rect.position + Vector2(0, rect.size.y))
};
Color c = Color(1, 0.6, 0.4, 0.7);
@@ -2212,7 +2212,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2 &r_rect, cons
lock.group = c->has_meta("_edit_group_");
if (lock.group || lock.lock) {
- lock.pos = xform.xform(rect.pos);
+ lock.pos = xform.xform(rect.position);
lock_list.push_back(lock);
}
@@ -2228,10 +2228,10 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2 &r_rect, cons
bone_list[id].last_pass = bone_last_frame;
}
- r_rect.expand_to(xform.xform(rect.pos));
- r_rect.expand_to(xform.xform(rect.pos + Point2(rect.size.x, 0)));
- r_rect.expand_to(xform.xform(rect.pos + Point2(0, rect.size.y)));
- r_rect.expand_to(xform.xform(rect.pos + rect.size));
+ r_rect.expand_to(xform.xform(rect.position));
+ r_rect.expand_to(xform.xform(rect.position + Point2(rect.size.x, 0)));
+ r_rect.expand_to(xform.xform(rect.position + Point2(0, rect.size.y)));
+ r_rect.expand_to(xform.xform(rect.position + rect.size));
}
}
@@ -2277,19 +2277,19 @@ void CanvasItemEditor::_update_scrollbars() {
//expand area so it's easier to do animations and stuff at 0,0
canvas_item_rect.size += screen_rect * 2;
- canvas_item_rect.pos -= screen_rect;
+ canvas_item_rect.position -= screen_rect;
Point2 ofs;
if (canvas_item_rect.size.height <= (local_rect.size.y / zoom)) {
v_scroll->hide();
- ofs.y = canvas_item_rect.pos.y;
+ ofs.y = canvas_item_rect.position.y;
} else {
v_scroll->show();
- v_scroll->set_min(canvas_item_rect.pos.y);
- v_scroll->set_max(canvas_item_rect.pos.y + canvas_item_rect.size.y);
+ v_scroll->set_min(canvas_item_rect.position.y);
+ v_scroll->set_max(canvas_item_rect.position.y + canvas_item_rect.size.y);
v_scroll->set_page(local_rect.size.y / zoom);
if (first_update) {
//so 0,0 is visible
@@ -2304,12 +2304,12 @@ void CanvasItemEditor::_update_scrollbars() {
if (canvas_item_rect.size.width <= (local_rect.size.x / zoom)) {
h_scroll->hide();
- ofs.x = canvas_item_rect.pos.x;
+ ofs.x = canvas_item_rect.position.x;
} else {
h_scroll->show();
- h_scroll->set_min(canvas_item_rect.pos.x);
- h_scroll->set_max(canvas_item_rect.pos.x + canvas_item_rect.size.x);
+ h_scroll->set_min(canvas_item_rect.position.x);
+ h_scroll->set_max(canvas_item_rect.position.x + canvas_item_rect.size.x);
h_scroll->set_page(local_rect.size.x / zoom);
ofs.x = h_scroll->get_value();
}
@@ -2977,7 +2977,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
Transform2D t(angle, Vector2(0.f, 0.f));
item_rect = t.xform(item_rect);
- Rect2 canvas_item_rect(pos + scale * item_rect.pos, scale * item_rect.size);
+ Rect2 canvas_item_rect(pos + scale * item_rect.position, scale * item_rect.size);
if (count == 1) {
rect = canvas_item_rect;
} else {
@@ -2988,7 +2988,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
if (p_op == VIEW_CENTER_TO_SELECTION) {
- center = rect.pos + rect.size / 2;
+ center = rect.position + rect.size / 2;
Vector2 offset = viewport->get_size() / 2 - editor->get_scene_root()->get_global_canvas_transform().xform(center);
h_scroll->set_value(h_scroll->get_value() - offset.x / zoom);
v_scroll->set_value(v_scroll->get_value() - offset.y / zoom);
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index d9963a422a..dd13ca0e63 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -675,14 +675,14 @@ void Polygon2DEditor::_uv_draw() {
rect = rect.grow(200);
updating_uv_scroll = true;
- uv_hscroll->set_min(rect.pos.x);
- uv_hscroll->set_max(rect.pos.x + rect.size.x);
+ uv_hscroll->set_min(rect.position.x);
+ uv_hscroll->set_max(rect.position.x + rect.size.x);
uv_hscroll->set_page(uv_edit_draw->get_size().x);
uv_hscroll->set_value(uv_draw_ofs.x);
uv_hscroll->set_step(0.001);
- uv_vscroll->set_min(rect.pos.y);
- uv_vscroll->set_max(rect.pos.y + rect.size.y);
+ uv_vscroll->set_min(rect.position.y);
+ uv_vscroll->set_max(rect.position.y + rect.size.y);
uv_vscroll->set_page(uv_edit_draw->get_size().y);
uv_vscroll->set_value(uv_draw_ofs.y);
uv_vscroll->set_step(0.001);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index c60adf9e7b..3536ecd094 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -1752,10 +1752,10 @@ static void stroke_rect(CanvasItem *ci, Rect2 rect, Color color, real_t width =
// a---b
// | |
// c---d
- Vector2 a(rect.pos);
- Vector2 b(rect.pos.x + rect.size.x, rect.pos.y);
- Vector2 c(rect.pos.x, rect.pos.y + rect.size.y);
- Vector2 d(rect.pos + rect.size);
+ Vector2 a(rect.position);
+ Vector2 b(rect.position.x + rect.size.x, rect.position.y);
+ Vector2 c(rect.position.x, rect.position.y + rect.size.y);
+ Vector2 d(rect.position + rect.size);
ci->draw_line(a, b, color, width);
ci->draw_line(b, d, color, width);
@@ -1804,15 +1804,15 @@ void SpatialEditorViewport::_draw() {
case Camera::KEEP_WIDTH: {
draw_rect.size = Size2(s.width, s.width / aspect);
- draw_rect.pos.x = 0;
- draw_rect.pos.y = (s.height - draw_rect.size.y) * 0.5;
+ draw_rect.position.x = 0;
+ draw_rect.position.y = (s.height - draw_rect.size.y) * 0.5;
} break;
case Camera::KEEP_HEIGHT: {
draw_rect.size = Size2(s.height * aspect, s.height);
- draw_rect.pos.y = 0;
- draw_rect.pos.x = (s.width - draw_rect.size.x) * 0.5;
+ draw_rect.position.y = 0;
+ draw_rect.position.x = (s.width - draw_rect.size.x) * 0.5;
} break;
}
@@ -1846,7 +1846,7 @@ void SpatialEditorViewport::_draw() {
real_t sy = r.size.y * logscale_t;
surface->draw_rect(r, Color(1, 1, 1, 0.2));
- surface->draw_rect(Rect2(r.pos.x, r.pos.y + r.size.y - sy, r.size.x, sy), Color(1, 1, 1, 0.6));
+ surface->draw_rect(Rect2(r.position.x, r.position.y + r.size.y - sy, r.size.x, sy), Color(1, 1, 1, 0.6));
stroke_rect(surface, r.grow(1), Color(0, 0, 0, 0.7));
}
}
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 6382164628..976a7b6271 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -114,10 +114,10 @@ void TextureRegionEditor::_region_draw() {
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {
Rect2 r = E->get();
Vector2 endpoints[4] = {
- mtx.basis_xform(r.pos),
- mtx.basis_xform(r.pos + Vector2(r.size.x, 0)),
- mtx.basis_xform(r.pos + r.size),
- mtx.basis_xform(r.pos + Vector2(0, r.size.y))
+ mtx.basis_xform(r.position),
+ mtx.basis_xform(r.position + Vector2(r.size.x, 0)),
+ mtx.basis_xform(r.position + r.size),
+ mtx.basis_xform(r.position + Vector2(0, r.size.y))
};
for (int i = 0; i < 4; i++) {
int next = (i + 1) % 4;
@@ -132,10 +132,10 @@ void TextureRegionEditor::_region_draw() {
scroll_rect.expand_to(mtx.basis_xform(edit_draw->get_size()));
Vector2 endpoints[4] = {
- mtx.basis_xform(rect.pos),
- mtx.basis_xform(rect.pos + Vector2(rect.size.x, 0)),
- mtx.basis_xform(rect.pos + rect.size),
- mtx.basis_xform(rect.pos + Vector2(0, rect.size.y))
+ mtx.basis_xform(rect.position),
+ mtx.basis_xform(rect.position + Vector2(rect.size.x, 0)),
+ mtx.basis_xform(rect.position + rect.size),
+ mtx.basis_xform(rect.position + Vector2(0, rect.size.y))
};
Color color(0.9, 0.5, 0.5);
for (int i = 0; i < 4; i++) {
@@ -162,14 +162,14 @@ void TextureRegionEditor::_region_draw() {
scroll_rect = scroll_rect.grow(200);
updating_scroll = true;
- hscroll->set_min(scroll_rect.pos.x);
- hscroll->set_max(scroll_rect.pos.x + scroll_rect.size.x);
+ hscroll->set_min(scroll_rect.position.x);
+ hscroll->set_max(scroll_rect.position.x + scroll_rect.size.x);
hscroll->set_page(edit_draw->get_size().x);
hscroll->set_value(draw_ofs.x);
hscroll->set_step(0.001);
- vscroll->set_min(scroll_rect.pos.y);
- vscroll->set_max(scroll_rect.pos.y + scroll_rect.size.y);
+ vscroll->set_min(scroll_rect.position.y);
+ vscroll->set_max(scroll_rect.position.y + scroll_rect.size.y);
vscroll->set_page(edit_draw->get_size().y);
vscroll->set_value(draw_ofs.y);
vscroll->set_step(0.001);
@@ -208,14 +208,14 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
mtx.scale_basis(Vector2(draw_zoom, draw_zoom));
Vector2 endpoints[8] = {
- mtx.xform(rect.pos) + Vector2(-4, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x / 2, 0)) + Vector2(0, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x, 0)) + Vector2(4, -4),
- mtx.xform(rect.pos + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(4, 0),
- mtx.xform(rect.pos + rect.size) + Vector2(4, 4),
- mtx.xform(rect.pos + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, 4),
- mtx.xform(rect.pos + Vector2(0, rect.size.y)) + Vector2(-4, 4),
- mtx.xform(rect.pos + Vector2(0, rect.size.y / 2)) + Vector2(-4, 0)
+ mtx.xform(rect.position) + Vector2(-4, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, 0)) + Vector2(0, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x, 0)) + Vector2(4, -4),
+ mtx.xform(rect.position + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(4, 0),
+ mtx.xform(rect.position + rect.size) + Vector2(4, 4),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, 4),
+ mtx.xform(rect.position + Vector2(0, rect.size.y)) + Vector2(-4, 4),
+ mtx.xform(rect.position + Vector2(0, rect.size.y / 2)) + Vector2(-4, 0)
};
Ref<InputEventMouseButton> mb;
@@ -239,10 +239,10 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT);
}
Vector2 pos[4] = {
- mtx.basis_xform(rect.pos + Vector2(0, margins[0])) - draw_ofs,
- mtx.basis_xform(rect.pos + rect.size - Vector2(0, margins[1])) - draw_ofs,
- mtx.basis_xform(rect.pos + Vector2(margins[2], 0)) - draw_ofs,
- mtx.basis_xform(rect.pos + rect.size - Vector2(margins[3], 0)) - draw_ofs
+ mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs,
+ mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs,
+ mtx.basis_xform(rect.position + Vector2(margins[2], 0)) - draw_ofs,
+ mtx.basis_xform(rect.position + rect.size - Vector2(margins[3], 0)) - draw_ofs
};
if (Math::abs(mb->get_position().y - pos[0].y) < 8) {
edited_margin = 0;
@@ -277,8 +277,8 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
r = obj_styleBox->get_region_rect();
else if (atlas_tex.is_valid())
r = atlas_tex->get_region();
- rect.expand_to(r.pos);
- rect.expand_to(r.pos + r.size);
+ rect.expand_to(r.position);
+ rect.expand_to(r.position + r.size);
}
undo_redo->create_action("Set Region Rect");
if (node_sprite) {
@@ -439,49 +439,49 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
switch (drag_index) {
case 0: {
- Vector2 p = rect_prev.pos + rect_prev.size;
+ Vector2 p = rect_prev.position + rect_prev.size;
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 1: {
- Vector2 p = rect_prev.pos + Vector2(0, rect_prev.size.y);
+ Vector2 p = rect_prev.position + Vector2(0, rect_prev.size.y);
rect = Rect2(p, Size2(rect_prev.size.x, 0));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 2: {
- Vector2 p = rect_prev.pos + Vector2(0, rect_prev.size.y);
+ Vector2 p = rect_prev.position + Vector2(0, rect_prev.size.y);
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 3: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2(0, rect_prev.size.y));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 4: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 5: {
- Vector2 p = rect_prev.pos;
+ Vector2 p = rect_prev.position;
rect = Rect2(p, Size2(rect_prev.size.x, 0));
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 6: {
- Vector2 p = rect_prev.pos + Vector2(rect_prev.size.x, 0);
+ Vector2 p = rect_prev.position + Vector2(rect_prev.size.x, 0);
rect = Rect2(p, Size2());
rect.expand_to(new_pos);
apply_rect(rect);
} break;
case 7: {
- Vector2 p = rect_prev.pos + Vector2(rect_prev.size.x, 0);
+ Vector2 p = rect_prev.position + Vector2(rect_prev.size.x, 0);
rect = Rect2(p, Size2(0, rect_prev.size.y));
rect.expand_to(new_pos);
apply_rect(rect);
@@ -693,7 +693,7 @@ void TextureRegionEditor::_edit_region() {
if (grown.has_point(Point2(x, y))) {
E->get().expand_to(Point2(x, y));
E->get().expand_to(Point2(x + 1, y + 1));
- x = E->get().pos.x + E->get().size.x - 1;
+ x = E->get().position.x + E->get().size.x - 1;
bool merged = true;
while (merged) {
merged = false;
@@ -706,8 +706,8 @@ void TextureRegionEditor::_edit_region() {
if (F == E)
continue;
if (E->get().grow(1).intersects(F->get())) {
- E->get().expand_to(F->get().pos);
- E->get().expand_to(F->get().pos + F->get().size);
+ E->get().expand_to(F->get().position);
+ E->get().expand_to(F->get().position + F->get().size);
if (F->prev()) {
F = F->prev();
autoslice_cache.erase(F->next());
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 282670e695..d12b979121 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -98,8 +98,8 @@ void TileMapEditor::_menu_option(int p_option) {
return;
undo_redo->create_action("Erase Selection");
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
_set_cell(Point2i(j, i), TileMap::INVALID_CELL, false, false, false, true);
}
@@ -333,7 +333,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
}
Rect2i r = node->get_item_rect();
- r.pos = r.pos / node->get_cell_size();
+ r.position = r.position / node->get_cell_size();
r.size = r.size / node->get_cell_size();
int area = r.get_area();
@@ -349,7 +349,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
invalidate_cache = true;
}
// Tile ID changed or position wasn't visited by the previous fill
- int loc = (p_start.x - r.get_pos().x) + (p_start.y - r.get_pos().y) * r.get_size().x;
+ int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x;
if (prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) {
invalidate_cache = true;
}
@@ -380,7 +380,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
if (node->get_cell(n.x, n.y) == prev_id) {
if (preview) {
- int loc = (n.x - r.get_pos().x) + (n.y - r.get_pos().y) * r.get_size().x;
+ int loc = (n.x - r.position.x) + (n.y - r.position.y) * r.get_size().x;
if (bucket_cache_visited[loc])
continue;
bucket_cache_visited[loc] = true;
@@ -441,7 +441,7 @@ void TileMapEditor::_select(const Point2i &p_from, const Point2i &p_to) {
SWAP(begin.y, end.y);
}
- rectangle.pos = begin;
+ rectangle.position = begin;
rectangle.size = end - begin;
canvas_item_editor->update();
@@ -460,7 +460,7 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i &p_point, bool p_flip_h
Size2 sc = p_xform.get_scale();
Rect2 rect = Rect2();
- rect.pos = node->map_to_world(p_point) + node->get_cell_draw_offset();
+ rect.position = node->map_to_world(p_point) + node->get_cell_draw_offset();
if (r.has_no_area()) {
rect.size = t->get_size();
@@ -490,42 +490,42 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i &p_point, bool p_flip_h
if (node->get_tile_origin() == TileMap::TILE_ORIGIN_TOP_LEFT) {
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
} else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_BOTTOM_LEFT) {
Size2 cell_size = node->get_cell_size();
- rect.pos += tile_ofs;
+ rect.position += tile_ofs;
if (p_transpose) {
if (p_flip_h)
- rect.pos.x -= cell_size.x;
+ rect.position.x -= cell_size.x;
else
- rect.pos.x += cell_size.x;
+ rect.position.x += cell_size.x;
} else {
if (p_flip_v)
- rect.pos.y -= cell_size.y;
+ rect.position.y -= cell_size.y;
else
- rect.pos.y += cell_size.y;
+ rect.position.y += cell_size.y;
}
} else if (node->get_tile_origin() == TileMap::TILE_ORIGIN_CENTER) {
- rect.pos += node->get_cell_size() / 2;
+ rect.position += node->get_cell_size() / 2;
Vector2 s = r.size;
Vector2 center = (s / 2) - tile_ofs;
if (p_flip_h)
- rect.pos.x -= s.x - center.x;
+ rect.position.x -= s.x - center.x;
else
- rect.pos.x -= center.x;
+ rect.position.x -= center.x;
if (p_flip_v)
- rect.pos.y -= s.y - center.y;
+ rect.position.y -= s.y - center.y;
else
- rect.pos.y -= center.y;
+ rect.position.y -= center.y;
}
- rect.pos = p_xform.xform(rect.pos);
+ rect.position = p_xform.xform(rect.position);
rect.size *= sc;
if (r.has_no_area())
@@ -560,9 +560,9 @@ void TileMapEditor::_update_copydata() {
if (!selection_active)
return;
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
TileData tcd;
@@ -737,8 +737,8 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (id != TileMap::INVALID_CELL) {
undo_redo->create_action("Rectangle Paint");
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
_set_cell(Point2i(j, i), id, flip_h, flip_v, transpose, true);
}
@@ -749,7 +749,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
}
} else if (tool == TOOL_DUPLICATING) {
- Point2 ofs = over_tile - rectangle.pos;
+ Point2 ofs = over_tile - rectangle.position;
undo_redo->create_action(TTR("Duplicate"));
for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
@@ -985,8 +985,8 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
paint_undo.clear();
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
Point2i tile = Point2i(j, i);
paint_undo[tile] = _get_op_from_cell(tile);
@@ -1103,7 +1103,7 @@ void TileMapEditor::_canvas_draw() {
Size2 screen_size = canvas_item_editor->get_size();
{
Rect2 aabb;
- aabb.pos = node->world_to_map(xform_inv.xform(Vector2()));
+ aabb.position = node->world_to_map(xform_inv.xform(Vector2()));
aabb.expand_to(node->world_to_map(xform_inv.xform(Vector2(0, screen_size.height))));
aabb.expand_to(node->world_to_map(xform_inv.xform(Vector2(screen_size.width, 0))));
aabb.expand_to(node->world_to_map(xform_inv.xform(screen_size)));
@@ -1113,10 +1113,10 @@ void TileMapEditor::_canvas_draw() {
int max_lines = 2000; //avoid crash if size too smal
- for (int i = (si.pos.x) - 1; i <= (si.pos.x + si.size.x); i++) {
+ for (int i = (si.position.x) - 1; i <= (si.position.x + si.size.x); i++) {
- Vector2 from = xform.xform(node->map_to_world(Vector2(i, si.pos.y)));
- Vector2 to = xform.xform(node->map_to_world(Vector2(i, si.pos.y + si.size.y + 1)));
+ Vector2 from = xform.xform(node->map_to_world(Vector2(i, si.position.y)));
+ Vector2 to = xform.xform(node->map_to_world(Vector2(i, si.position.y + si.size.y + 1)));
Color col = i == 0 ? Color(1, 0.8, 0.2, 0.5) : Color(1, 0.3, 0.1, 0.2);
canvas_item_editor->draw_line(from, to, col, 1);
@@ -1127,9 +1127,9 @@ void TileMapEditor::_canvas_draw() {
int max_lines = 10000; //avoid crash if size too smal
- for (int i = (si.pos.x) - 1; i <= (si.pos.x + si.size.x); i++) {
+ for (int i = (si.position.x) - 1; i <= (si.position.x + si.size.x); i++) {
- for (int j = (si.pos.y) - 1; j <= (si.pos.y + si.size.y); j++) {
+ for (int j = (si.position.y) - 1; j <= (si.position.y + si.size.y); j++) {
Vector2 ofs;
if (ABS(j) & 1) {
@@ -1151,10 +1151,10 @@ void TileMapEditor::_canvas_draw() {
if (node->get_half_offset() != TileMap::HALF_OFFSET_Y) {
- for (int i = (si.pos.y) - 1; i <= (si.pos.y + si.size.y); i++) {
+ for (int i = (si.position.y) - 1; i <= (si.position.y + si.size.y); i++) {
- Vector2 from = xform.xform(node->map_to_world(Vector2(si.pos.x, i)));
- Vector2 to = xform.xform(node->map_to_world(Vector2(si.pos.x + si.size.x + 1, i)));
+ Vector2 from = xform.xform(node->map_to_world(Vector2(si.position.x, i)));
+ Vector2 to = xform.xform(node->map_to_world(Vector2(si.position.x + si.size.x + 1, i)));
Color col = i == 0 ? Color(1, 0.8, 0.2, 0.5) : Color(1, 0.3, 0.1, 0.2);
canvas_item_editor->draw_line(from, to, col, 1);
@@ -1164,9 +1164,9 @@ void TileMapEditor::_canvas_draw() {
}
} else {
- for (int i = (si.pos.y) - 1; i <= (si.pos.y + si.size.y); i++) {
+ for (int i = (si.position.y) - 1; i <= (si.position.y + si.size.y); i++) {
- for (int j = (si.pos.x) - 1; j <= (si.pos.x + si.size.x); j++) {
+ for (int j = (si.position.x) - 1; j <= (si.position.x + si.size.x); j++) {
Vector2 ofs;
if (ABS(j) & 1) {
@@ -1188,10 +1188,10 @@ void TileMapEditor::_canvas_draw() {
if (selection_active) {
Vector<Vector2> points;
- points.push_back(xform.xform(node->map_to_world((rectangle.pos))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(rectangle.size.x + 1, 0)))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(rectangle.size.x + 1, rectangle.size.y + 1)))));
- points.push_back(xform.xform(node->map_to_world((rectangle.pos + Point2(0, rectangle.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(rectangle.size.x + 1, 0)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(rectangle.size.x + 1, rectangle.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((rectangle.position + Point2(0, rectangle.size.y + 1)))));
canvas_item_editor->draw_colored_polygon(points, Color(0.2, 0.8, 1, 0.4));
}
@@ -1248,8 +1248,8 @@ void TileMapEditor::_canvas_draw() {
if (id == TileMap::INVALID_CELL)
return;
- for (int i = rectangle.pos.y; i <= rectangle.pos.y + rectangle.size.y; i++) {
- for (int j = rectangle.pos.x; j <= rectangle.pos.x + rectangle.size.x; j++) {
+ for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) {
+ for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) {
_draw_cell(id, Point2i(j, i), flip_h, flip_v, transpose, xform);
}
@@ -1264,7 +1264,7 @@ void TileMapEditor::_canvas_draw() {
if (ts.is_null())
return;
- Point2 ofs = over_tile - rectangle.pos;
+ Point2 ofs = over_tile - rectangle.position;
for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
@@ -1277,13 +1277,13 @@ void TileMapEditor::_canvas_draw() {
}
Rect2i duplicate = rectangle;
- duplicate.pos = over_tile;
+ duplicate.position = over_tile;
Vector<Vector2> points;
- points.push_back(xform.xform(node->map_to_world(duplicate.pos)));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(duplicate.size.x + 1, 0)))));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(duplicate.size.x + 1, duplicate.size.y + 1)))));
- points.push_back(xform.xform(node->map_to_world((duplicate.pos + Point2(0, duplicate.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world(duplicate.position)));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(duplicate.size.x + 1, 0)))));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(duplicate.size.x + 1, duplicate.size.y + 1)))));
+ points.push_back(xform.xform(node->map_to_world((duplicate.position + Point2(0, duplicate.size.y + 1)))));
canvas_item_editor->draw_colored_polygon(points, Color(0.2, 1.0, 0.8, 0.2));
diff --git a/editor/project_settings.cpp b/editor/project_settings.cpp
index 1c4ca3cb58..8ef7bd427f 100644
--- a/editor/project_settings.cpp
+++ b/editor/project_settings.cpp
@@ -430,8 +430,8 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
if (p_id == 1) {
Point2 ofs = input_editor->get_global_position();
Rect2 ir = input_editor->get_item_rect(ti);
- ir.pos.y -= input_editor->get_scroll().y;
- ofs += ir.pos + ir.size;
+ ir.position.y -= input_editor->get_scroll().y;
+ ofs += ir.position + ir.size;
ofs.x -= 100;
popup_add->set_position(ofs);
popup_add->popup();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index b113d1b7ad..d1b79ea7aa 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -678,8 +678,8 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
field_names.push_back("h");
config_value_editors(4, 4, 10, field_names);
Rect2 r = v;
- value_editor[0]->set_text(String::num(r.pos.x));
- value_editor[1]->set_text(String::num(r.pos.y));
+ value_editor[0]->set_text(String::num(r.position.x));
+ value_editor[1]->set_text(String::num(r.position.y));
value_editor[2]->set_text(String::num(r.size.x));
value_editor[3]->set_text(String::num(r.size.y));
} break;
@@ -1539,13 +1539,13 @@ void CustomPropertyEditor::_modified(String p_string) {
Rect2 r2;
if (evaluator) {
- r2.pos.x = evaluator->eval(value_editor[0]->get_text());
- r2.pos.y = evaluator->eval(value_editor[1]->get_text());
+ r2.position.x = evaluator->eval(value_editor[0]->get_text());
+ r2.position.y = evaluator->eval(value_editor[1]->get_text());
r2.size.x = evaluator->eval(value_editor[2]->get_text());
r2.size.y = evaluator->eval(value_editor[3]->get_text());
} else {
- r2.pos.x = value_editor[0]->get_text().to_double();
- r2.pos.y = value_editor[1]->get_text().to_double();
+ r2.position.x = value_editor[0]->get_text().to_double();
+ r2.position.y = value_editor[1]->get_text().to_double();
r2.size.x = value_editor[2]->get_text().to_double();
r2.size.y = value_editor[3]->get_text().to_double();
}
@@ -3674,7 +3674,7 @@ void PropertyEditor::_draw_transparency(Object *t, const Rect2 &p_rect) {
// make a little space between consecutive color fields
Rect2 area = p_rect;
- area.pos.y += 1;
+ area.position.y += 1;
area.size.height -= 2;
area.size.width -= arrow->get_size().width + 5;
tree->draw_texture_rect(get_icon("Transparent", "EditorIcons"), area, true);
@@ -3942,7 +3942,7 @@ void PropertyEditor::_custom_editor_request(bool p_arrow) {
int hint = d.has("hint") ? d["hint"].operator int() : -1;
String hint_text = d.has("hint_text") ? d["hint_text"] : "";
Rect2 where = tree->get_custom_popup_rect();
- custom_editor->set_position(where.pos);
+ custom_editor->set_position(where.position);
if (custom_editor->edit(obj, name, type, v, hint, hint_text)) {
custom_editor->popup();
@@ -4049,9 +4049,9 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
Variant v = obj->get(n);
custom_editor->edit(obj, n, (Variant::Type)t, v, h, ht);
Rect2 where = tree->get_item_rect(ti, 1);
- where.pos -= tree->get_scroll();
- where.pos += tree->get_global_position();
- custom_editor->set_position(where.pos);
+ where.position -= tree->get_scroll();
+ where.position += tree->get_global_position();
+ custom_editor->set_position(where.position);
custom_editor->popup();
} else if (t == Variant::STRING) {
@@ -4062,9 +4062,9 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
if (h == PROPERTY_HINT_FILE || h == PROPERTY_HINT_DIR || h == PROPERTY_HINT_GLOBAL_DIR || h == PROPERTY_HINT_GLOBAL_FILE) {
Rect2 where = tree->get_item_rect(ti, 1);
- where.pos -= tree->get_scroll();
- where.pos += tree->get_global_position();
- custom_editor->set_position(where.pos);
+ where.position -= tree->get_scroll();
+ where.position += tree->get_global_position();
+ custom_editor->set_position(where.position);
custom_editor->popup();
} else {
custom_editor->popup_centered_ratio();
@@ -4140,7 +4140,7 @@ void PropertyEditor::_draw_flags(Object *t, const Rect2 &p_rect) {
if (i == 1)
ofs.y += bsize + 1;
- ofs += p_rect.pos;
+ ofs += p_rect.position;
for (int j = 0; j < 10; j++) {
Point2 o = ofs + Point2(j * (bsize + 1), 0);
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 2945abbd8c..d4e5714c0d 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -161,17 +161,17 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
if (p_id == BUTTON_SUBSCENE) {
//open scene request
Rect2 item_rect = tree->get_item_rect(item, 0);
- item_rect.pos.y -= tree->get_scroll().y;
- item_rect.pos += tree->get_global_position();
+ item_rect.position.y -= tree->get_scroll().y;
+ item_rect.position += tree->get_global_position();
if (n == get_scene_node()) {
- inheritance_menu->set_position(item_rect.pos + Vector2(0, item_rect.size.y));
+ inheritance_menu->set_position(item_rect.position + Vector2(0, item_rect.size.y));
inheritance_menu->set_size(Vector2(item_rect.size.x, 0));
inheritance_menu->popup();
instance_node = n->get_instance_ID();
} else {
- instance_menu->set_position(item_rect.pos + Vector2(0, item_rect.size.y));
+ instance_menu->set_position(item_rect.position + Vector2(0, item_rect.size.y));
instance_menu->set_size(Vector2(item_rect.size.x, 0));
if (EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(n))
instance_menu->set_item_checked(0, true);
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index a2bb3a0879..7f1e6023bf 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -790,19 +790,19 @@ void ScriptEditorDebugger::_performance_draw() {
Point2i p(i % cols, i / cols);
Rect2i r(p * s, s);
- r.pos += Point2(margin, margin);
+ r.position += Point2(margin, margin);
r.size -= Point2(margin, margin) * 2.0;
perf_draw->draw_style_box(graph_sb, r);
- r.pos += graph_sb->get_offset();
+ r.position += graph_sb->get_offset();
r.size -= graph_sb->get_minimum_size();
int pi = which[i];
Color c = Color(0.7, 0.9, 0.5);
c.set_hsv(Math::fmod(c.get_h() + pi * 0.7654, 1), c.get_s(), c.get_v());
c.a = 0.8;
- perf_draw->draw_string(graph_font, r.pos + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x);
+ perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x);
c.a = 0.6;
- perf_draw->draw_string(graph_font, r.pos + Point2(graph_font->get_char_size('X').width, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y);
+ perf_draw->draw_string(graph_font, r.position + Point2(graph_font->get_char_size('X').width, graph_font->get_ascent() + graph_font->get_height()), perf_items[pi]->get_text(1), c, r.size.y);
float spacing = point_sep / float(cols);
float from = r.size.width;
@@ -819,7 +819,7 @@ void ScriptEditorDebugger::_performance_draw() {
c.a = 0.7;
if (E != perf_history.front())
- perf_draw->draw_line(r.pos + Point2(from, h), r.pos + Point2(from + spacing, prev), c, 2.0);
+ perf_draw->draw_line(r.position + Point2(from, h), r.position + Point2(from + spacing, prev), c, 2.0);
prev = h;
E = E->next();
from -= spacing;