diff --git a/common/attrlist.c b/common/attrlist.c index 5c75da58..9a785dd3 100644 --- a/common/attrlist.c +++ b/common/attrlist.c @@ -296,6 +296,7 @@ static int specsIdentical(struct attr *attr, uiAttributeSpec *spec) // TODO use a closest match? return attr->spec.Double == spec->Double; case uiAttributeColor: + case uiAttributeBackground: // TODO use a closest match? return attr->spec.R == spec->R && attr->spec.G == spec->G && diff --git a/examples/drawtext/attributes.c b/examples/drawtext/attributes.c index d5c47058..63e2e762 100644 --- a/examples/drawtext/attributes.c +++ b/examples/drawtext/attributes.c @@ -76,6 +76,20 @@ static void setupAttributedString(void) uiAttributedStringAppendUnattributed(attrstr, ", "); + next = "multiple backgrounds"; + start = uiAttributedStringLen(attrstr); + end = start + strlen(next); + uiAttributedStringAppendUnattributed(attrstr, next); + spec.Type = uiAttributeBackground; + // Direct2D "Peach Puff" (#FFDAB9) + spec.R = 1.0; + spec.G = 0.85490196078431372; + spec.B = 0.7254901960784313; + spec.A = 0.5; + uiAttributedStringSetAttribute(attrstr, &spec, start, end); + + uiAttributedStringAppendUnattributed(attrstr, ", "); + next = "multiple TODO"; } diff --git a/ui_attrstr.h b/ui_attrstr.h index 62a82f77..4fa90aea 100644 --- a/ui_attrstr.h +++ b/ui_attrstr.h @@ -8,6 +8,7 @@ _UI_ENUM(uiAttribute) { uiAttributeItalic, uiAttributeStretch, uiAttributeColor, // use R, G, B, A + uiAttributeBackground, // use R, G, B, A // TODO // TODO uiAttributeSystem, // TODO uiAttributeCustom,