Reorder negative font weight checks in qtWeightFromCFWeight.

This fixes a problem that caused the QFont::Thin and QFont::ExtraLight
conditions to be unreachable.

Change-Id: I62a701c53222edffbddbf868311111374ae5bea8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
bb10
Jake Petroules 2016-05-05 02:10:24 -07:00
parent 7c1326a1c3
commit 2e304751b3
1 changed files with 4 additions and 4 deletions

View File

@ -75,12 +75,12 @@ QFont::Weight QCoreTextFontEngine::qtWeightFromCFWeight(float value)
return QFont::Medium;
if (value == 0.0)
return QFont::Normal;
if (value <= -0.4)
return QFont::Light;
if (value <= -0.6)
return QFont::ExtraLight;
if (value <= -0.8)
return QFont::Thin;
if (value <= -0.6)
return QFont::ExtraLight;
if (value <= -0.4)
return QFont::Light;
return QFont::Normal;
}