Commit 10201179 authored by cutealien's avatar cutealien

fix rounding problem in IGUIElements which have EGUIA_SCALE alignments.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2697 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 64ad07a3
...@@ -252,7 +252,7 @@ public: ...@@ -252,7 +252,7 @@ public:
DesiredRect.UpperLeftCorner.X += diffx/2; DesiredRect.UpperLeftCorner.X += diffx/2;
break; break;
case EGUIA_SCALE: case EGUIA_SCALE:
DesiredRect.UpperLeftCorner.X = (s32)(ScaleRect.UpperLeftCorner.X * fw); DesiredRect.UpperLeftCorner.X = core::round32(ScaleRect.UpperLeftCorner.X * fw);
break; break;
} }
...@@ -267,7 +267,7 @@ public: ...@@ -267,7 +267,7 @@ public:
DesiredRect.LowerRightCorner.X += diffx/2; DesiredRect.LowerRightCorner.X += diffx/2;
break; break;
case EGUIA_SCALE: case EGUIA_SCALE:
DesiredRect.LowerRightCorner.X = (s32)(ScaleRect.LowerRightCorner.X * fw); DesiredRect.LowerRightCorner.X = core::round32(ScaleRect.LowerRightCorner.X * fw);
break; break;
} }
...@@ -282,7 +282,7 @@ public: ...@@ -282,7 +282,7 @@ public:
DesiredRect.UpperLeftCorner.Y += diffy/2; DesiredRect.UpperLeftCorner.Y += diffy/2;
break; break;
case EGUIA_SCALE: case EGUIA_SCALE:
DesiredRect.UpperLeftCorner.Y = (s32)(ScaleRect.UpperLeftCorner.Y * fh); DesiredRect.UpperLeftCorner.Y = core::round32(ScaleRect.UpperLeftCorner.Y * fh);
break; break;
} }
...@@ -297,7 +297,7 @@ public: ...@@ -297,7 +297,7 @@ public:
DesiredRect.LowerRightCorner.Y += diffy/2; DesiredRect.LowerRightCorner.Y += diffy/2;
break; break;
case EGUIA_SCALE: case EGUIA_SCALE:
DesiredRect.LowerRightCorner.Y = (s32)(ScaleRect.LowerRightCorner.Y * fh); DesiredRect.LowerRightCorner.Y = core::round32(ScaleRect.LowerRightCorner.Y * fh);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment