only set shear and rotation with valid values

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25220 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-04-27 18:35:59 +00:00
parent 05bc1e8973
commit a1a5f1241f

View File

@ -405,11 +405,13 @@ BView::BView(BMessage *archive)
font.SetSize(size);
float shear;
if (archive->FindFloat("_fflt", 1, &shear) == B_OK)
if (archive->FindFloat("_fflt", 1, &shear) == B_OK
&& shear >= 45.0 && shear <= 135.0)
font.SetShear(shear);
float rotation;
if (archive->FindFloat("_fflt", 2, &rotation) == B_OK)
if (archive->FindFloat("_fflt", 2, &rotation) == B_OK
&& rotation >=0 && rotation <= 360)
font.SetRotation(rotation);
SetFont(&font, B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE