mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
RichText: Diagram fipped text improvement
This commit is contained in:
parent
75a00f91b4
commit
95e667a3e8
1 changed files with 12 additions and 3 deletions
|
|
@ -189,13 +189,11 @@ void DiagramItem::Paint(Painter& w, const Diagram& diagram, dword style, const I
|
|||
|
||||
w.Begin();
|
||||
if(flip_horz) {
|
||||
// flip horz
|
||||
w.Translate(cx, 0);
|
||||
w.Scale(-1, 1);
|
||||
}
|
||||
|
||||
if(flip_vert) {
|
||||
// flip horz
|
||||
w.Translate(0, cy);
|
||||
w.Scale(1, -1);
|
||||
}
|
||||
|
|
@ -406,6 +404,17 @@ void DiagramItem::Paint(Painter& w, const Diagram& diagram, dword style, const I
|
|||
}
|
||||
|
||||
w.End();
|
||||
|
||||
Rectf tr2 = text_rect;
|
||||
if(flip_horz) {
|
||||
text_rect.right = cx - tr2.left;
|
||||
text_rect.left = cx - tr2.right;
|
||||
}
|
||||
|
||||
if(flip_vert) {
|
||||
text_rect.top = cy - tr2.bottom;
|
||||
text_rect.bottom = cy - tr2.top;
|
||||
}
|
||||
|
||||
Rect tr = text_rect;
|
||||
int txt_cy = txt.GetHeight(pi.zoom, tr.GetWidth());
|
||||
|
|
@ -465,4 +474,4 @@ Sizef DiagramItem::GetStdSize(const Diagram& diagram) const
|
|||
return Size(128, 64);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue