X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvslider.cpp;h=a32e484906c19b0944599a47f8b0932adde24b0b;hb=3d84860cb25cf05ed36ee6cbd07d9e58cee52422;hp=874c38346c9e75a496058540ce1ec5b399685ec1;hpb=43ac7c4514658754d09552463425bcd344fb9ded;p=libs%2Fgltk.git diff --git a/source/vslider.cpp b/source/vslider.cpp index 874c383..a32e484 100644 --- a/source/vslider.cpp +++ b/source/vslider.cpp @@ -1,12 +1,5 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007-2008, 2010-2011 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include -#include +#include #include "graphic.h" #include "part.h" #include "style.h" @@ -35,7 +28,7 @@ void VSlider::autosize() } } -void VSlider::render_special(const Part &part) const +void VSlider::rebuild_special(const Part &part, CachedPart &cache) { if(part.get_name()=="slider") { @@ -46,10 +39,12 @@ void VSlider::render_special(const Part &part) const Geometry pgeom = part.get_geometry(); align.apply(pgeom, geom, part.get_margin()); - GL::push_matrix(); - GL::translate(pgeom.x, pgeom.y, 0); - part.get_graphic(state)->render(pgeom.w, pgeom.h); - GL::pop_matrix(); + cache.texture = part.get_graphic(state)->get_texture(); + cache.clear_mesh(); + + GL::MeshBuilder bld(*cache.mesh); + bld.matrix() *= GL::Matrix::translation(pgeom.x, pgeom.y, 0); + part.get_graphic(state)->build(pgeom.w, pgeom.h, bld); } }