X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhslider.cpp;h=837b2ba5c2dae4a0344da91665661079c7e427ef;hb=c8291177b545ec81930603a5915234a60296db51;hp=2a3644367ea52adb85beeb1f2f02abad007fc25c;hpb=eb6eee5fabf05abca4a0434c2a8f8f62c900afec;p=libs%2Fgltk.git diff --git a/source/hslider.cpp b/source/hslider.cpp index 2a36443..837b2ba 100644 --- a/source/hslider.cpp +++ b/source/hslider.cpp @@ -28,12 +28,12 @@ void HSlider::autosize() } } -void HSlider::rebuild_special(const Part &part, CachedPart &cache) +void HSlider::rebuild_special(const Part &part) { if(part.get_name()=="slider") { const Graphic *graphic = part.get_graphic(state); - if(!graphic) + if(!graphic || !graphic->get_texture()) return; Alignment align = part.get_alignment(); @@ -43,10 +43,7 @@ void HSlider::rebuild_special(const Part &part, CachedPart &cache) Geometry pgeom = part.get_geometry(); align.apply(pgeom, geom, part.get_margin()); - cache.texture = part.get_graphic(state)->get_texture(); - cache.clear_mesh(); - - GL::MeshBuilder bld(*cache.mesh); + 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); }