summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/2d/path_2d.cpp4
-rw-r--r--scene/gui/button.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 4f24b0e004..742756113f 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -93,6 +93,10 @@ void Path2D::_notification(int p_what) {
return;
}
+ if (curve->get_point_count() < 2) {
+ return;
+ }
+
#ifdef TOOLS_ENABLED
const real_t line_width = 2 * EDSCALE;
#else
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 25e931c287..dc030d6f3d 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -302,6 +302,8 @@ void Button::_notification(int p_what) {
Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - text_buf->get_size() - Point2(_internal_margin[SIDE_RIGHT] - _internal_margin[SIDE_LEFT], 0)) / 2.0;
+ text_buf->set_alignment(align_rtl_checked);
+ text_buf->set_width(text_width);
switch (align_rtl_checked) {
case HORIZONTAL_ALIGNMENT_FILL:
case HORIZONTAL_ALIGNMENT_LEFT: {