Skip to content

Commit 35c3ef5

Browse files
committed
fixed font artifacts
1 parent d266160 commit 35c3ef5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/ui/geometry/Rectangle.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "Rectangle.h"
22

3+
#include <cmath>
4+
35
#include "ui/UI.h"
46
#include "types/mesh/Rectangle.h"
57
#include "scene/actor/Mesh.h"
@@ -40,14 +42,14 @@ void Rectangle::UpdateImpl() {
4042
if ( m_mesh ) {
4143
const auto top_left = m_ui->ClampXY(
4244
{
43-
m_area.left,
44-
m_area.top,
45+
std::round( m_area.left ),
46+
std::round( m_area.top ),
4547
}
4648
);
4749
const auto bottom_right = m_ui->ClampXY(
4850
{
49-
m_area.right,
50-
m_area.bottom,
51+
std::round( m_area.right ),
52+
std::round( m_area.bottom ),
5153
}
5254
);
5355
if ( m_tile_dimensions.x && m_tile_dimensions.y ) {

src/ui/geometry/Text.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ void Text::UpdateImpl() {
2222
if ( m_actor ) {
2323
m_actor->SetPosition(
2424
{
25-
m_ui->ClampX( m_area.left ),
26-
m_ui->ClampY( m_area.bottom ),
25+
m_ui->ClampX( std::round( m_area.left ) ),
26+
m_ui->ClampY( std::round( m_area.bottom ) ),
2727
m_area.zindex,
2828
}
2929
);

0 commit comments

Comments
 (0)