Skip to content

Commit 36489b8

Browse files
committed
minor fixes to the last commit
1 parent 98ccbdf commit 36489b8

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/gui/profile/ProfileViewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void ProfileViewer::OnTick(float dt)
8181
this->AddComponent(locationLabel);
8282
this->AddComponent(websiteLabel);
8383
this->AddComponent(biographyLabel);
84-
if (biographyLabel->GetSize().Y+115 > this->GetSize().Y)
84+
if (biographyLabel->GetSize().Y+117 > this->GetSize().Y)
8585
this->SetScrollable(true, biographyLabel->GetSize().Y+117-this->GetSize().Y*2);
8686

8787
// If we don't do this average score will have a ton of decimal points, round to 2 here

src/interface/Component.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Component
2121
bool IsFocused();
2222
bool IsClicked();
2323
Point GetPosition() { return position; }
24+
void SetPosition(Point position_) { position = position_; }
2425
Point GetSize() { return size; }
2526

2627
virtual void OnMouseDown(int x, int y, unsigned char button) { }
@@ -31,8 +32,6 @@ class Component
3132
virtual void OnTick() { }
3233

3334
virtual void OnDefocus() { }
34-
35-
friend class ScrollWindow;
3635
};
3736

3837
#endif

src/interface/ScrollWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void ScrollWindow::DoMouseWheel(int x, int y, int d)
2020

2121
for (std::vector<Component*>::iterator iter = Components.begin(), end = Components.end(); iter != end; iter++)
2222
{
23-
(*iter)->position.Y -= (scrolled-oldScrolled);
23+
(*iter)->SetPosition(Point((*iter)->GetPosition().X, (*iter)->GetPosition().Y-(scrolled-oldScrolled)));
2424
}
2525
}
2626

0 commit comments

Comments
 (0)