- int sw=get_slider_width();
- int sx=geom.x+static_cast<int>((geom.w-sw)*(value-min)/(max-min));
- if(btn==1 && x>=sx && x<sx+sw)
- {
- dragging=true;
- state=ACTIVE;
- drag_start_x=x;
- drag_start_value=value;
- }
+ const Graphic *graphic = part.get_graphic(state);
+ if(!graphic || !graphic->get_texture())
+ return;
+
+ Alignment align = part.get_alignment();
+ if(max>min)
+ align.x = (value-min)/(max-min);
+
+ Geometry pgeom = part.get_geometry();
+ align.apply(pgeom, geom, part.get_margin());
+
+ GL::MeshBuilder bld(part_cache.create_mesh(part, *graphic->get_texture()));
+ bld.matrix() *= GL::Matrix::translation(pgeom.x, pgeom.y, 0);
+ graphic->build(pgeom.w, pgeom.h, bld);