X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhslider.cpp;h=2a3644367ea52adb85beeb1f2f02abad007fc25c;hb=eb6eee5fabf05abca4a0434c2a8f8f62c900afec;hp=fbd9b943a8c4703dc8fe77acc542df843777173f;hpb=5e97c5c224c30e68c26fddd2153694088f932bee;p=libs%2Fgltk.git diff --git a/source/hslider.cpp b/source/hslider.cpp index fbd9b94..2a36443 100644 --- a/source/hslider.cpp +++ b/source/hslider.cpp @@ -32,6 +32,10 @@ void HSlider::rebuild_special(const Part &part, CachedPart &cache) { if(part.get_name()=="slider") { + const Graphic *graphic = part.get_graphic(state); + if(!graphic) + return; + Alignment align = part.get_alignment(); if(max>min) align.x = (value-min)/(max-min); @@ -44,7 +48,7 @@ void HSlider::rebuild_special(const Part &part, CachedPart &cache) 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); + graphic->build(pgeom.w, pgeom.h, bld); } }