Primitive visual bevel fix. 67/88767/2
authorAndrew Poor <andrew.poor@samsung.com>
Tue, 20 Sep 2016 12:33:01 +0000 (13:33 +0100)
committerAndrew Poor <andrew.poor@samsung.com>
Tue, 20 Sep 2016 12:45:16 +0000 (13:45 +0100)
Change-Id: I76ebb85325faed9a25135e2abf933a1faaacbe85

dali-toolkit/internal/visuals/primitive/primitive-visual.cpp

index 6991f32d7113be4a2c72a01bc1055e24c8bd27a4..325a9cd6164e4475186eb6463f9cd34499ed9513 100644 (file)
@@ -533,7 +533,8 @@ void PrimitiveVisual::CreateConic( Vector<Vertex>& vertices, Vector<unsigned sho
 void PrimitiveVisual::CreateBevelledCube( Vector<Vertex>& vertices, Vector<unsigned short>& indices,
                                             Vector3 dimensions, float bevelPercentage, float bevelSmoothness )
 {
-  dimensions.Normalize();
+  float maxDimension = std::max( std::max( dimensions.x, dimensions.y ), dimensions.z );
+  dimensions = dimensions / maxDimension;
 
   if( bevelPercentage <= MIN_BEVEL_PERCENTAGE ) //No bevel, form a cube.
   {