X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fcontrolpanel.cpp;fp=src%2Fcontrolpanel.cpp;h=f2d032414bfef229107615b3b7217260668711d1;hp=41013d0bea1406e3cf2e005c1138808d8fd3aa6e;hb=16f404f3edf222c467639f3e898eeb505075cde8;hpb=398e6b2732decd57cdb57deb3f91d3ff08669e8b diff --git a/src/controlpanel.cpp b/src/controlpanel.cpp index 41013d0..f2d0324 100644 --- a/src/controlpanel.cpp +++ b/src/controlpanel.cpp @@ -224,14 +224,13 @@ void ControlPanel::SetViewBounds() void ControlPanel::InsertTextIntoDocument() { const Rect & bounds = m_view.GetBounds(); - Real xx = bounds.x + bounds.w/Real(2); + Real xx = bounds.x; Real yy = bounds.y + bounds.h/Real(2); string msg = m_text_edit->toPlainText().toStdString(); - Real scale = bounds.w / Real(2); + Real scale = bounds.h / Real(2); Debug("Insert \"%s\" at %f, %f, scale %f", msg.c_str(), Float(xx), Float(yy), Float(scale)); - //m_doc.Add(RECT_OUTLINE, bounds, 0); // debugging; text needs to go in the boujnds - m_doc.AddText(msg, xx, yy, scale); + m_doc.AddText(msg, scale, xx, yy); m_view.ForceRenderDirty(); m_view.ForceBufferDirty(); m_view.ForceBoundsDirty();