diff --git a/gb.gtk/src/cpaint_impl.cpp b/gb.gtk/src/cpaint_impl.cpp index dbe130c5f..a5164eb0f 100644 --- a/gb.gtk/src/cpaint_impl.cpp +++ b/gb.gtk/src/cpaint_impl.cpp @@ -260,6 +260,11 @@ static int Begin(GB_PAINT *d) EXTRA(d)->context = ((CDRAWINGAREA *)device)->context; cairo_reference(CONTEXT(d)); + + GtkAllocation a; + gtk_widget_get_allocation(wid->border, &a); + dx = a.x; + dy = a.y; } d->resolutionX = gDesktop::resolution(); //device->physicalDpiX(); diff --git a/gb.gtk/src/gslider.cpp b/gb.gtk/src/gslider.cpp index f82eef9b8..ce6ea9c25 100644 --- a/gb.gtk/src/gslider.cpp +++ b/gb.gtk/src/gslider.cpp @@ -195,8 +195,8 @@ int gSlider::value() void gSlider::setMax(int vl) { _max = vl; - if (_min > _max) - _min = _max; + if (_min >= _max) + _min = _max - 1; init(); updateMark(); } @@ -204,8 +204,8 @@ void gSlider::setMax(int vl) void gSlider::setMin(int vl) { _min = vl; - if (_min > _max) - _max = _min; + if (_min >= _max) + _max = _min + 1; init(); updateMark(); }