3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 bool Geometry::is_inside(int x_, int y_) const
15 return (x_>=x && x_<x+static_cast<int>(w) && y_>=y && y_<y+static_cast<int>(h));
27 Sides::Loader::Loader(Sides &s):
30 add("top", &Sides::top);
31 add("right", &Sides::right);
32 add("bottom", &Sides::bottom);
33 add("left", &Sides::left);
37 void Alignment::apply(Geometry &geom, const Geometry &parent) const
39 geom.x+=static_cast<int>((parent.w-geom.w)*x);
40 geom.y+=static_cast<int>((parent.h-geom.h)*y);
43 void Alignment::apply(Geometry &geom, const Geometry &parent, const Sides &margin) const
45 geom.x+=static_cast<int>(margin.left+(parent.w-margin.left-margin.right-geom.w)*x);
46 geom.y+=static_cast<int>(margin.bottom+(parent.h-margin.bottom-margin.top-geom.h)*y);