[open-type] Add static_assert for NO_VARIATION

This commit is contained in:
Behdad Esfahbod 2022-12-16 11:26:24 -07:00
parent d4496e6405
commit bf2ae3f0ca
2 changed files with 2 additions and 1 deletions

View File

@ -212,6 +212,7 @@ typedef Index NameID;
struct VarIdx : HBUINT32 {
static constexpr unsigned NO_VARIATION = 0xFFFFFFFFu;
static_assert (NO_VARIATION == HB_OT_LAYOUT_NO_VARIATIONS_INDEX, "");
VarIdx& operator = (uint32_t i) { HBUINT32::operator= (i); return *this; }
};
DECLARE_NULL_NAMESPACE_BYTES (OT, VarIdx);

View File

@ -940,7 +940,7 @@ struct ClipBox
int ymin = u.format1.yMin;
int xmax = u.format1.xMax;
int ymax = u.format1.yMax;
if (u.format == 2 && instancer && u.format2.varIdxBase != HB_OT_LAYOUT_NO_VARIATIONS_INDEX)
if (u.format == 2 && instancer && u.format2.varIdxBase != VarIdx::NO_VARIATION)
{
uint32_t varIdx = u.format2.varIdxBase;
xmin += _hb_roundf (instancer (varIdx+0));