Skip to content

Commit

Permalink
KOTOR: Add method to change size of the widget
Browse files Browse the repository at this point in the history
  • Loading branch information
vkremianskii authored and DrMcCoy committed May 22, 2018
1 parent 1d134b6 commit 4dd0fa1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/engines/kotor/gui/widgets/kotorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ bool KotORWidget::isHighlight() {
return _highlighted;
}

void KotORWidget::setSize(float width, float height) {
if (_quad) {
_quad->setWidth(width);
_quad->setHeight(height);
}
if (_text)
_text->setSize(width, height);
_width = width;
_height = height;
}

void KotORWidget::setWidth(float width) {
if (_quad)
_quad->setWidth(width);
Expand Down
2 changes: 2 additions & 0 deletions src/engines/kotor/gui/widgets/kotorwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class KotORWidget : public Widget {
/** If the widget is highlighted. */
bool isHighlight();

/** Set size of the widget. */
void setSize(float width, float height);
/** Set the width of the widget. */
void setWidth(float width);
/** Set the height of the widget. */
Expand Down

0 comments on commit 4dd0fa1

Please sign in to comment.