|
|
|
|
@ -69,7 +69,7 @@ impl From<&DynamicText> for XMLElement {
|
|
|
|
|
// 计算基础位置(不考虑旋转)
|
|
|
|
|
// txt.x和txt.y现在是左下角位置
|
|
|
|
|
let left_x = txt.x;
|
|
|
|
|
// align_x 是对齐点的x坐标,后面加的数字是考虑到QET中boundingRect的没有完全贴合文本内容
|
|
|
|
|
// align_x 是对齐点的x坐标
|
|
|
|
|
let mut align_x = match txt.h_alignment {
|
|
|
|
|
HAlignment::Left => txt.align_x,
|
|
|
|
|
HAlignment::Center => txt.align_x,
|
|
|
|
|
@ -83,13 +83,13 @@ impl From<&DynamicText> for XMLElement {
|
|
|
|
|
VAlignment::Bottom => txt.y - pt_size + pt_size / 2.0,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// align_y 是对齐点的y坐标,后面加的数字是考虑到QET中boundingRect的没有完全贴合文本内容
|
|
|
|
|
// align_y 是对齐点的y坐标
|
|
|
|
|
let mut align_y = match txt.v_alignment {
|
|
|
|
|
VAlignment::Top => txt.align_y,
|
|
|
|
|
VAlignment::Center => txt.align_y,
|
|
|
|
|
VAlignment::Bottom => txt.align_y
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if txt.h_alignment == HAlignment::Left && txt.v_alignment==VAlignment::Bottom {
|
|
|
|
|
align_x = txt.x;
|
|
|
|
|
align_y = txt.y;
|
|
|
|
|
|