GlyphJustificationInfo[] infos = new GlyphJustificationInfo[infoCount];
// get justification infos
int compStart = 0;
for (int i = 0; i < newComponents.length; i++) {
TextLineComponent comp = newComponents[i];
int compLength = comp.getNumCharacters();
int compLimit = compStart + compLength;
if (compLimit > justStart) {
int rangeMin = Math.max(0, justStart - compStart);
int rangeMax = Math.min(compLength, justLimit - compStart);
comp.getJustificationInfos(infos, infoPositions[i], rangeMin, rangeMax);
if (compLimit >= justLimit) {
break;
}
}
}
// records are visually ordered, and contiguous, so start and end are
// simply the places where we didn't fetch records
int infoStart = 0;
int infoLimit = infoCount;
while (infoStart < infoLimit && infos[infoStart] == null) {
++infoStart;
}
while (infoLimit > infoStart && infos[infoLimit - 1] == null) {
--infoLimit;
}
// invoke justifier on the records
TextJustifier justifier = new TextJustifier(infos, infoStart, infoLimit);
float[] deltas = justifier.justify(justifyDelta);
boolean canRejustify = rejustify == false;
boolean wantRejustify = false;
boolean[] flags = new boolean[1];
// apply justification deltas
compStart = 0;
for (int i = 0; i < newComponents.length; i++) {
TextLineComponent comp = newComponents[i];
int compLength = comp.getNumCharacters();
int compLimit = compStart + compLength;
if (compLimit > justStart) {
int rangeMin = Math.max(0, justStart - compStart);
int rangeMax = Math.min(compLength, justLimit - compStart);
newComponents[i] = comp.applyJustificationDeltas(deltas, infoPositions[i] * 2, flags);
wantRejustify |= flags[0];
if (compLimit >= justLimit) {
break;