Added SetDepth function to FTBBox
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/test/FTBBox-Test.cpp b/test/FTBBox-Test.cpp
index 88ac1da..02dfb62 100755
--- a/test/FTBBox-Test.cpp
+++ b/test/FTBBox-Test.cpp
@@ -19,6 +19,7 @@ class FTBBoxTest : public CppUnit::TestCase
CPPUNIT_TEST( testGlyphConstructor);
CPPUNIT_TEST( testMoveBBox);
CPPUNIT_TEST( testPlusEquals);
+ CPPUNIT_TEST( testSetDepth);
CPPUNIT_TEST_SUITE_END();
public:
@@ -121,6 +122,24 @@ class FTBBoxTest : public CppUnit::TestCase
tearDownFreetype();
}
+ void testSetDepth()
+ {
+ setUpFreetype();
+
+ FTBBox boundingBox( face->glyph);
+
+ boundingBox.SetDepth( 37.754);
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 2, boundingBox.lowerX, 0.01);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, boundingBox.lowerY, 0.01);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, boundingBox.lowerZ, 0.01);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 35, boundingBox.upperX, 0.01);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 38, boundingBox.upperY, 0.01);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 37.754, boundingBox.upperZ, 0.01);
+
+ tearDownFreetype();
+ }
+
void setUp()
{}