QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
    Andrew
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 3 RC2
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: QCAD Bugtracker
Opened by Peter - 07.12.2011
Last edited by Andrew - 07.12.2011

FS#421 - Multiline Text in SVG Exporter PG

Multiline text is in the wrong place. Please see patch below:

— SvgExporterPG.js~ 2011-11-04 22:08:57.000000000 +0100
+++ SvgExporterPG.js 2011-12-07 13:01:43.811533803 +0100
@@ -248,7 +248,8 @@

   this.writeStartElement("flowRoot"); // <flowRoot>
   this.writeFontAttributes();
   var bb = this.text.getBoundingBox();

- var pos = this.text.getPosition();
+ var pos = this.text.getPosition(); always (0,0) ?
+ var pos = bb.getCenter(); // still not right, but closer

   var x = this.convert(pos.x);
   var y = this.convert(pos.y);
   var a = 360 - RMath.rad2deg(this.text.getAngle());
Closed by  Andrew
07.12.2011 15:14
Reason for closing:  Fixed
Additional comments about closing:  

r19941

Peter commented on 07.12.2011 12:06

Better readable patch:

--- SvgExporterPG.js~	2011-11-04 22:08:57.000000000 +0100
+++ SvgExporterPG.js	2011-12-07 13:01:43.811533803 +0100
@@ -248,7 +248,8 @@
     this.writeStartElement("flowRoot"); // <flowRoot>
     this.writeFontAttributes();
     var bb = this.text.getBoundingBox();
-    var pos = this.text.getPosition();
+    //var pos = this.text.getPosition(); // always (0,0) ?
+    var pos = bb.getCenter(); // still not right, but closer
     var x = this.convert(pos.x);
     var y = this.convert(pos.y);
Admin
Andrew commented on 07.12.2011 15:13

Thanks.

Here's a refactored and fixed method exportMultiLineText:

// <flowRoot>
//   <flowRegion>
//     <rect width="54.667633" height="28.062719" x="38.44957"
//       y="5.6952629"/>
//   </flowRegion>
//   <flowPara>line1</flowPara>
//   <flowPara>line2</flowPara>
// </flowRoot>
"flowRoot"// adds some additional space to be sure all characters are shown:
"""text-anchor:middle;text-align:center""text-anchor:end;text-align:end""transform""scale(1,-1) ""rotate("", "", "") ""translate("", "")""flowRegion""rect""width""height""x""y""rect""flowRegion"// <flowPara>line1</flowPara>
"flowPara""""style""flowPara""flowRoot"

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing