MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / appendRange

Function appendRange

JUCE/modules/juce_graphics/fonts/juce_AttributedString.cpp:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 }
87
88 void appendRange (Array<AttributedString::Attribute>& atts,
89 int length, const Font* f, const Colour* c)
90 {
91 if (atts.size() == 0)
92 {
93 atts.add ({ Range<int> (0, length), f != nullptr ? *f : Font(), c != nullptr ? *c : Colour (0xff000000) });
94 }
95 else
96 {
97 auto start = getLength (atts);
98 atts.add ({ Range<int> (start, start + length),
99 f != nullptr ? *f : atts.getReference (atts.size() - 1).font,
100 c != nullptr ? *c : atts.getReference (atts.size() - 1).colour });
101
102 mergeAdjacentRanges (atts);
103 }
104 }
105
106 void applyFontAndColour (Array<AttributedString::Attribute>& atts,
107 Range<int> range, const Font* f, const Colour* c)

Callers 2

setTextMethod · 0.85
appendMethod · 0.85

Calls 7

FontClass · 0.85
ColourFunction · 0.85
getLengthFunction · 0.85
mergeAdjacentRangesFunction · 0.85
getReferenceMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected