mirror of https://gitee.com/antv-l7/antv-l7
feat: `PointLayer` support multi lines (#837)
This commit is contained in:
parent
fb64f1d1c8
commit
f918b4fc13
|
@ -419,7 +419,7 @@ export default class TextModel extends BaseModel {
|
|||
// @ts-ignore
|
||||
size,
|
||||
textAnchor,
|
||||
'center',
|
||||
'left',
|
||||
spacing,
|
||||
textOffset,
|
||||
iconfont,
|
||||
|
|
|
@ -174,7 +174,7 @@ function shapeLines(
|
|||
}
|
||||
|
||||
x = 0;
|
||||
y += lineHeight;
|
||||
y -= lineHeight + 5;
|
||||
});
|
||||
|
||||
const { horizontalAlign, verticalAlign } = getAnchorAlignment(textAnchor);
|
||||
|
@ -192,7 +192,7 @@ function shapeLines(
|
|||
const height = y - yOffset;
|
||||
|
||||
shaping.top += -verticalAlign * height;
|
||||
shaping.bottom = shaping.top + height;
|
||||
shaping.bottom = shaping.top - height;
|
||||
shaping.left += -horizontalAlign * maxLineLength;
|
||||
shaping.right = shaping.left + maxLineLength;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ function shapeIconFont(
|
|||
}
|
||||
|
||||
x = 0;
|
||||
y += lineHeight;
|
||||
y -= lineHeight + 5;
|
||||
});
|
||||
|
||||
const { horizontalAlign, verticalAlign } = getAnchorAlignment(textAnchor);
|
||||
|
@ -267,7 +267,7 @@ function shapeIconFont(
|
|||
const height = y - yOffset;
|
||||
|
||||
shaping.top += -verticalAlign * height;
|
||||
shaping.bottom = shaping.top + height;
|
||||
shaping.bottom = shaping.top - height;
|
||||
shaping.left += -horizontalAlign * maxLineLength;
|
||||
shaping.right = shaping.left + maxLineLength;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ export default class TextLayerDemo extends React.Component {
|
|||
y: 'w',
|
||||
},
|
||||
})
|
||||
.shape('s', 'text')
|
||||
.shape(['s', 'm'], (...args) => args.map(i => `${i}\n`).join(''))
|
||||
// .shape('circle')
|
||||
.size(18)
|
||||
.filter('t', (t) => {
|
||||
|
|
Loading…
Reference in New Issue