X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgeometry.cpp;h=126a0fc7aa48b731d72819dc70ec302575062d37;hb=8f6f543758fb1b2b17ae2db519198d420eb9982d;hp=81efcd05bad2e69d22325eb3e7df851f638d3644;hpb=6be5b834084fb3ab421b94b6c4ad8eece6bab754;p=libs%2Fgltk.git diff --git a/source/geometry.cpp b/source/geometry.cpp index 81efcd0..126a0fc 100644 --- a/source/geometry.cpp +++ b/source/geometry.cpp @@ -36,12 +36,22 @@ Sides::Loader::Loader(Sides &s): void Alignment::apply(Geometry &geom, const Geometry &parent) const { + if(parent.w>geom.w) + geom.w+=static_cast((parent.w-geom.w)*w); + if(parent.h>geom.h) + geom.h+=static_cast((parent.h-geom.h)*h); + geom.x+=static_cast((parent.w-geom.w)*x); geom.y+=static_cast((parent.h-geom.h)*y); } void Alignment::apply(Geometry &geom, const Geometry &parent, const Sides &margin) const { + if(parent.w>geom.w) + geom.w+=static_cast((parent.w-geom.w)*w); + if(parent.h>geom.h) + geom.h+=static_cast((parent.h-geom.h)*h); + geom.x+=static_cast(margin.left+(parent.w-margin.left-margin.right-geom.w)*x); geom.y+=static_cast(margin.bottom+(parent.h-margin.bottom-margin.top-geom.h)*y); }