From 34cd87e0d9f19276488f6c34421b9958e725e4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 16 Feb 2014 23:12:50 +0000 Subject: [PATCH] [GB.GTK] * BUG: Fix a Slider warning when setting the MinValue or MaxValue property. [GB.GTK3] * BUG: Painting a DrawingArea is done with the correct origin now. git-svn-id: svn://localhost/gambas/trunk@6163 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/cpaint_impl.cpp | 5 +++++ gb.gtk/src/gslider.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) 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(); }