Browse Source

Round scrollbar box size to avoid some off-by-one pixel situations.

Michael Ragazzon 5 years ago
parent
commit
b93bd9d36f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Source/Core/WidgetScroll.cpp

+ 3 - 3
Source/Core/WidgetScroll.cpp

@@ -360,7 +360,7 @@ void WidgetScroll::FormatBar(float bar_length)
 	}
 
 	// Set the new dimensions on the bar to re-decorate it.
-	bar_box.SetContent(bar_box_content);
+	bar_box.SetContent(bar_box_content.Round());
 	bar->SetBox(bar_box);
 
 	// Now that it's been resized, re-position it.
@@ -455,8 +455,8 @@ void WidgetScroll::ProcessEvent(Event& event)
 
 void WidgetScroll::PositionBar()
 {
-	const Vector2f& track_dimensions = track->GetBox().GetSize();
-	const Vector2f& bar_dimensions = bar->GetBox().GetSize(Box::BORDER);
+	const Vector2f track_dimensions = track->GetBox().GetSize();
+	const Vector2f bar_dimensions = bar->GetBox().GetSize(Box::BORDER);
 
 	if (orientation == VERTICAL)
 	{