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:
@@ -405,11 +405,13 @@ BView::BView(BMessage *archive)
|
|||||||
font.SetSize(size);
|
font.SetSize(size);
|
||||||
|
|
||||||
float shear;
|
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);
|
font.SetShear(shear);
|
||||||
|
|
||||||
float rotation;
|
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);
|
font.SetRotation(rotation);
|
||||||
|
|
||||||
SetFont(&font, B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE
|
SetFont(&font, B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE
|
||||||
|
|||||||
Reference in New Issue
Block a user