]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/alignment.cpp
Initial revision
[libs/gltk.git] / source / alignment.cpp
diff --git a/source/alignment.cpp b/source/alignment.cpp
new file mode 100644 (file)
index 0000000..bb5d392
--- /dev/null
@@ -0,0 +1,14 @@
+#include <msp/gl/transform.h>
+#include "alignment.h"
+#include "geometry.h"
+
+namespace Msp {
+namespace GLtk {
+
+void Alignment::apply(const Geometry &geom, unsigned wd, unsigned ht) const
+{
+       GL::translate((geom.w-wd)*(x+1)/2, (geom.h-ht)*(y+1)/2, 0);
+}
+
+} // namespace GLtk
+} // namespace Msp