|
@@ -22,7 +22,7 @@ export default class Poster {
|
|
|
|
|
|
fontSize = fontSize.replace("px", "");
|
|
fontSize = fontSize.replace("px", "");
|
|
fontSize = Math.ceil(Number(fontSize) * pixelRatio) + "px";
|
|
fontSize = Math.ceil(Number(fontSize) * pixelRatio) + "px";
|
|
- top = Math.ceil(top * pixelRatio);
|
|
|
|
|
|
+ top = Math.ceil((top >= 2000 ? top - 2000 : top) * pixelRatio);
|
|
left = Math.ceil(left * pixelRatio);
|
|
left = Math.ceil(left * pixelRatio);
|
|
if (pixelRatio > 3) {
|
|
if (pixelRatio > 3) {
|
|
// 曲面屏做适配
|
|
// 曲面屏做适配
|
|
@@ -89,7 +89,7 @@ export default class Poster {
|
|
case "content":
|
|
case "content":
|
|
canvasObj.views.push({
|
|
canvasObj.views.push({
|
|
type: "text",
|
|
type: "text",
|
|
- text: what,
|
|
|
|
|
|
+ text: what.replace(/[\r\n]/g, ""),
|
|
css: {
|
|
css: {
|
|
left: `${left}px`,
|
|
left: `${left}px`,
|
|
top: `${top}px`,
|
|
top: `${top}px`,
|
|
@@ -100,6 +100,7 @@ export default class Poster {
|
|
fontWeight: `${fontWeight}`,
|
|
fontWeight: `${fontWeight}`,
|
|
backgroundColor: `${backgroundColor}`,
|
|
backgroundColor: `${backgroundColor}`,
|
|
borderRadius: `${borderRadius}`,
|
|
borderRadius: `${borderRadius}`,
|
|
|
|
+ maxLines: 3,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
break;
|
|
break;
|