+void HSlider::autosize_special(const Part &part, Geometry &ageom)
+{
+ if(part.get_name()=="slider")
+ {
+ const Sides &margin = part.get_margin();
+ const Geometry &pgeom = part.get_geometry();
+ ageom.w = std::max(ageom.w, pgeom.w*3/2+margin.left+margin.right);
+ ageom.h = std::max(ageom.h, pgeom.h+margin.top+margin.bottom);
+ }
+}
+
+void HSlider::rebuild_special(const Part &part)
+{
+ if(part.get_name()=="slider")
+ {
+ 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);
+ }
+}
+