summaryrefslogtreecommitdiff
path: root/libs/ui/Region.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/Region.cpp')
-rw-r--r--libs/ui/Region.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 815093174c..618c7d62b1 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -325,14 +325,14 @@ Region& Region::translateSelf(int x, int y) {
return *this;
}
-Region& Region::scaleSelf(int sx, int sy) {
+Region& Region::scaleSelf(float sx, float sy) {
size_t count = mStorage.size();
Rect* rects = mStorage.editArray();
while (count) {
- rects->left *= sx;
- rects->right *= sx;
- rects->top *= sy;
- rects->bottom *= sy;
+ rects->left = static_cast<int32_t>(rects->left * sx + 0.5f);
+ rects->right = static_cast<int32_t>(rects->right * sx + 0.5f);
+ rects->top = static_cast<int32_t>(rects->top * sy + 0.5f);
+ rects->bottom = static_cast<int32_t>(rects->bottom * sy + 0.5f);
rects++;
count--;
}