summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/parallax_2d.cpp7
-rw-r--r--scene/gui/rich_text_label.cpp4
2 files changed, 8 insertions, 3 deletions
diff --git a/scene/2d/parallax_2d.cpp b/scene/2d/parallax_2d.cpp
index b3586a1da0..9dd9d4a376 100644
--- a/scene/2d/parallax_2d.cpp
+++ b/scene/2d/parallax_2d.cpp
@@ -31,6 +31,7 @@
#include "parallax_2d.h"
#include "core/config/project_settings.h"
+#include "scene/main/viewport.h"
void Parallax2D::_notification(int p_what) {
switch (p_what) {
@@ -72,7 +73,11 @@ void Parallax2D::_validate_property(PropertyInfo &p_property) const {
void Parallax2D::_camera_moved(const Transform2D &p_transform, const Point2 &p_screen_offset, const Point2 &p_adj_screen_pos) {
if (!ignore_camera_scroll) {
- set_screen_offset(p_adj_screen_pos);
+ if (get_viewport() && get_viewport()->is_snap_2d_transforms_to_pixel_enabled()) {
+ set_screen_offset((p_adj_screen_pos + Vector2(0.5, 0.5)).floor());
+ } else {
+ set_screen_offset(p_adj_screen_pos);
+ }
}
}
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 8ffa0f8c63..74978416c4 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -4947,10 +4947,10 @@ void RichTextLabel::append_text(const String &p_bbcode) {
tag_stack.push_front("outline_size");
} else if (bbcode_name == "fade") {
- int start_index = 0;
+ int start_index = brk_pos;
OptionMap::Iterator start_option = bbcode_options.find("start");
if (start_option) {
- start_index = start_option->value.to_int();
+ start_index += start_option->value.to_int();
}
int length = 10;