|
|
|
@ -8,7 +8,7 @@ const setTextStyles = require("./render/set-text-styles");
|
|
|
|
|
const measureText = require("./render/measure-text");
|
|
|
|
|
|
|
|
|
|
function getTextProperties(item) {
|
|
|
|
|
return objectPick(item, ["fontSize", "fontFamily", "fontStyle", "fontWeight", "fillColor", "strokeColor"]);
|
|
|
|
|
return objectPick(item, ["fontSize", "fontFamily", "fontStyle", "fontWeight", "fillColor", "strokeColor", "alignment"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = function createTextShape(options = {}) {
|
|
|
|
@ -16,7 +16,7 @@ module.exports = function createTextShape(options = {}) {
|
|
|
|
|
_layout: null,
|
|
|
|
|
_lines: null,
|
|
|
|
|
type: "text",
|
|
|
|
|
cacheBustingProperties: ["fillColor", "strokeColor", "strokeWidth"],
|
|
|
|
|
cacheBustingProperties: ["fillColor", "strokeColor", "strokeWidth", "alignment"],
|
|
|
|
|
sizeBustingProperties: ["text", "fontSize", "fontFamily", "fontStyle", "fontWeight", "trimVerticalWhitespace", "renderDebugLines", "renderDebugArea", "lineHeight", "tags"],
|
|
|
|
|
fillColor: "black",
|
|
|
|
|
strokeColor: "red",
|
|
|
|
@ -25,6 +25,7 @@ module.exports = function createTextShape(options = {}) {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: "normal",
|
|
|
|
|
lineHeight: 1.16,
|
|
|
|
|
alignment: "left",
|
|
|
|
|
tags: false,
|
|
|
|
|
text: "",
|
|
|
|
|
onRender: function onRender(context) {
|
|
|
|
|