GUI: Use clipping everywhere
This commit is contained in:
parent
dc9b32e620
commit
3d636617d0
7 changed files with 117 additions and 20 deletions
|
@ -99,7 +99,7 @@ void Widget::draw() {
|
|||
|
||||
// Draw border
|
||||
if (_flags & WIDGET_BORDER) {
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||
_x += 4;
|
||||
_y += 4;
|
||||
_w -= 8;
|
||||
|
@ -424,7 +424,7 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b) {
|
|||
}
|
||||
|
||||
void PicButtonWidget::drawWidget() {
|
||||
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), "", _state, getFlags());
|
||||
g_gui.theme()->drawButtonClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), "", _state, getFlags());
|
||||
|
||||
if (_gfx.getPixels()) {
|
||||
// Check whether the set up surface needs to be converted to the GUI
|
||||
|
@ -437,7 +437,7 @@ void PicButtonWidget::drawWidget() {
|
|||
const int x = _x + (_w - _gfx.w) / 2;
|
||||
const int y = _y + (_h - _gfx.h) / 2;
|
||||
|
||||
g_gui.theme()->drawSurface(Common::Rect(x, y, x + _gfx.w, y + _gfx.h), _gfx, _state, _alpha, _transparency);
|
||||
g_gui.theme()->drawSurfaceClip(Common::Rect(x, y, x + _gfx.w, y + _gfx.h), getBossClipRect(), _gfx, _state, _alpha, _transparency);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ void CheckboxWidget::setState(bool state) {
|
|||
}
|
||||
|
||||
void CheckboxWidget::drawWidget() {
|
||||
g_gui.theme()->drawCheckbox(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, Widget::_state);
|
||||
g_gui.theme()->drawCheckboxClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), _label, _state, Widget::_state);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
@ -541,7 +541,7 @@ void RadiobuttonWidget::setState(bool state, bool setGroup) {
|
|||
}
|
||||
|
||||
void RadiobuttonWidget::drawWidget() {
|
||||
g_gui.theme()->drawRadiobutton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, Widget::_state);
|
||||
g_gui.theme()->drawRadiobuttonClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), _label, _state, Widget::_state);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
@ -609,7 +609,7 @@ void SliderWidget::handleMouseWheel(int x, int y, int direction) {
|
|||
}
|
||||
|
||||
void SliderWidget::drawWidget() {
|
||||
g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state);
|
||||
g_gui.theme()->drawSliderClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), valueToBarWidth(_value), _state);
|
||||
}
|
||||
|
||||
int SliderWidget::valueToBarWidth(int value) {
|
||||
|
@ -723,7 +723,7 @@ void ContainerWidget::removeWidget(Widget *widget) {
|
|||
}
|
||||
|
||||
void ContainerWidget::drawWidget() {
|
||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||
}
|
||||
|
||||
} // End of namespace GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue