Merge pull request #11011 from mike-000/patch-3

Set background fill style for each declutter label
This commit is contained in:
Andreas Hocevar
2020-05-06 16:20:54 +02:00
committed by GitHub

View File

@@ -262,6 +262,7 @@ class Executor {
* @param {import("../../coordinate.js").Coordinate} p4 4th point of the background box.
* @param {Array<*>} fillInstruction Fill instruction.
* @param {Array<*>} strokeInstruction Stroke instruction.
* @param {boolean} declutter Declutter.
*/
replayTextBackground_(
context,
@@ -270,7 +271,8 @@ class Executor {
p3,
p4,
fillInstruction,
strokeInstruction
strokeInstruction,
declutter
) {
context.beginPath();
context.moveTo.apply(context, p1);
@@ -280,6 +282,9 @@ class Executor {
context.lineTo.apply(context, p1);
if (fillInstruction) {
this.alignFill_ = /** @type {boolean} */ (fillInstruction[2]);
if (declutter) {
context.fillStyle = /** @type {import("../../colorlike.js").ColorLike} */ (fillInstruction[1]);
}
this.fill_(context);
}
if (strokeInstruction) {
@@ -449,7 +454,8 @@ class Executor {
p3,
p4,
/** @type {Array<*>} */ (fillInstruction),
/** @type {Array<*>} */ (strokeInstruction)
/** @type {Array<*>} */ (strokeInstruction),
false
);
}
drawImageOrLabel(
@@ -542,7 +548,8 @@ class Executor {
declutterData[15],
declutterData[16],
declutterData[11],
declutterData[12]
declutterData[12],
true
);
}
drawImageOrLabel.apply(undefined, declutterData);