allow scale to be two dimensional
add getScaleArray() method test two dimension scale icons test two dimension scale text add example of icon and label scaling use smaller icon and larger interval test two dimensional scale icons test two dimensional scale icons
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user