Merge pull request #11037 from mike-000/patch-11

Allow icon and text styles to be scaled in two dimensions
This commit is contained in:
Andreas Hocevar
2020-06-13 10:00:06 +02:00
committed by GitHub
19 changed files with 528 additions and 111 deletions

View File

@@ -915,11 +915,11 @@ function createNameStyleFunction(foundStyle, name) {
imageSize = DEFAULT_IMAGE_STYLE_SIZE;
}
if (imageSize.length == 2) {
const imageScale = imageStyle.getScale();
const imageScale = imageStyle.getScaleArray();
// Offset the label to be centered to the right of the icon,
// if there is one.
textOffset[0] = (imageScale * imageSize[0]) / 2;
textOffset[1] = (-imageScale * imageSize[1]) / 2;
textOffset[0] = (imageScale[0] * imageSize[0]) / 2;
textOffset[1] = (-imageScale[1] * imageSize[1]) / 2;
textAlign = 'left';
}
}