X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Fhslider.cpp;h=d764797971029c08da73015f391e6ab6a9867795;hp=f19eafee419db334409007df3eb1e02be402856a;hb=ed9873ba7ee862ad76937f579fe371c1a27d5715;hpb=2f1c7d6861c801e24a003ee5f6132032e04c9bbe diff --git a/source/hslider.cpp b/source/hslider.cpp index f19eafe..d764797 100644 --- a/source/hslider.cpp +++ b/source/hslider.cpp @@ -55,27 +55,26 @@ void HSlider::pointer_motion(int x, int) } } -void HSlider::render_part(const Part &part) const +void HSlider::render_special(const Part &part) const { if(part.get_name()=="slider") { - unsigned gw=part.get_width(); - unsigned gh=(part.get_fill_y() ? geom.h : part.get_height()); + const Geometry &pgeom=part.get_geometry(); + unsigned gw=pgeom.w; + unsigned gh=(part.get_fill_y() ? geom.h : pgeom.h); GL::push_matrix(); GL::translate((geom.w-gw)*(value-min)/(max-min), (geom.h-gh)*(part.get_alignment().y+1)/2, 0); const Graphic *graphic=part.get_graphic(state); graphic->render(gw, gh); GL::pop_matrix(); } - else - Widget::render_part(part); } unsigned HSlider::get_slider_width() const { for(PartSeq::const_iterator i=style->get_parts().begin(); i!=style->get_parts().end(); ++i) if(i->get_name()=="slider") - return i->get_width(); + return i->get_geometry().w; return 0; }