mxVsdxCanvas2D.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /**
  2. * Copyright (c) 2006-2017, JGraph Ltd
  3. */
  4. /**
  5. * Class: mxVsdxCanvas2D
  6. *
  7. * Constructor: mxVsdxCanvas2D
  8. *
  9. * Constructs a new abstract canvas.
  10. */
  11. function mxVsdxCanvas2D(zip)
  12. {
  13. mxAbstractCanvas2D.call(this);
  14. };
  15. /**
  16. * Extends mxAbstractCanvas2D
  17. */
  18. mxUtils.extend(mxVsdxCanvas2D, mxAbstractCanvas2D);
  19. /**
  20. * Variable: textEnabled
  21. *
  22. * Specifies if text output should be enabled. Default is true.
  23. */
  24. mxVsdxCanvas2D.prototype.textEnabled = true;
  25. /**
  26. * Function: init
  27. *
  28. * Initialize the canvas for a new vsdx file.
  29. */
  30. mxVsdxCanvas2D.prototype.init = function (zip)
  31. {
  32. this.filesLoading = 0;
  33. this.zip = zip;
  34. };
  35. /**
  36. * Function: createGeoSec
  37. *
  38. * Create a new geo section.
  39. */
  40. mxVsdxCanvas2D.prototype.createGeoSec = function ()
  41. {
  42. if (this.geoSec != null)
  43. {
  44. this.shape.appendChild(this.geoSec);
  45. }
  46. var geoSec = this.xmlDoc.createElement("Section");
  47. geoSec.setAttribute("N", "Geometry");
  48. geoSec.setAttribute("IX", this.geoIndex++);
  49. this.geoSec = geoSec;
  50. this.geoStepIndex = 1;
  51. this.lastX = 0;
  52. this.lastY = 0;
  53. this.lastMoveToX = 0;
  54. this.lastMoveToY = 0;
  55. };
  56. /**
  57. * Function: newShape
  58. *
  59. * Create a new shape.
  60. */
  61. mxVsdxCanvas2D.prototype.newShape = function (shape, cellState, xmlDoc)
  62. {
  63. this.geoIndex = 0;
  64. this.shape = shape;
  65. this.cellState = cellState;
  66. this.xmGeo = cellState.cell.geometry;
  67. this.xmlDoc = xmlDoc;
  68. this.geoSec = null;
  69. this.shapeImg = null;
  70. this.shapeType = "Shape";
  71. this.createGeoSec();
  72. };
  73. /**
  74. * Function: endShape
  75. *
  76. * End current shape.
  77. */
  78. mxVsdxCanvas2D.prototype.endShape = function ()
  79. {
  80. if (this.shapeImg != null)
  81. {
  82. this.addForeignData(this.shapeImg.type, this.shapeImg.id);
  83. }
  84. };
  85. /**
  86. * Function: newPage
  87. *
  88. * Start a new page.
  89. */
  90. mxVsdxCanvas2D.prototype.newPage = function ()
  91. {
  92. this.images = [];
  93. };
  94. /**
  95. * Function: newPage
  96. *
  97. * Start a new page.
  98. */
  99. mxVsdxCanvas2D.prototype.getShapeType = function ()
  100. {
  101. return this.shapeType;
  102. };
  103. /**
  104. * Function: getShapeGeo
  105. *
  106. * return the current geo section.
  107. */
  108. mxVsdxCanvas2D.prototype.getShapeGeo = function ()
  109. {
  110. return this.geoSec;
  111. };
  112. /**
  113. * Function: createCellElemScaled
  114. *
  115. * Creates a cell element and scale the value.
  116. */
  117. mxVsdxCanvas2D.prototype.createCellElemScaled = function (name, val, formula)
  118. {
  119. return this.createCellElem(name, val / VsdxExport.prototype.CONVERSION_FACTOR, formula);
  120. };
  121. /**
  122. * Function: createCellElem
  123. *
  124. * Creates a cell element.
  125. */
  126. mxVsdxCanvas2D.prototype.createCellElem = function (name, val, formula)
  127. {
  128. var cell = this.xmlDoc.createElement("Cell");
  129. cell.setAttribute("N", name);
  130. cell.setAttribute("V", val);
  131. if (formula) cell.setAttribute("F", formula);
  132. return cell;
  133. };
  134. mxVsdxCanvas2D.prototype.createRowRel = function(type, index, x, y, a, b, c , d)
  135. {
  136. var row = this.xmlDoc.createElement("Row");
  137. row.setAttribute("T", type);
  138. row.setAttribute("IX", index);
  139. row.appendChild(this.createCellElem("X", x));
  140. row.appendChild(this.createCellElem("Y", y));
  141. if (a != null) row.appendChild(this.createCellElem("A", a));
  142. if (b != null) row.appendChild(this.createCellElem("B", b));
  143. if (c != null) row.appendChild(this.createCellElem("C", c));
  144. if (d != null) row.appendChild(this.createCellElem("D", d));
  145. return row;
  146. };
  147. /**
  148. * Function: begin
  149. *
  150. * Extends superclass to create path.
  151. */
  152. mxVsdxCanvas2D.prototype.begin = function()
  153. {
  154. if (this.geoStepIndex > 1) this.createGeoSec();
  155. };
  156. /**
  157. * Function: rect
  158. *
  159. * Private helper function to create SVG elements
  160. */
  161. mxVsdxCanvas2D.prototype.rect = function(x, y, w, h)
  162. {
  163. if (this.geoStepIndex > 1) this.createGeoSec();
  164. var s = this.state;
  165. w = w * s.scale;
  166. h = h * s.scale;
  167. var geo = this.xmGeo;
  168. x = ((x - geo.x + s.dx) * s.scale) /w;
  169. y = ((geo.height - y + geo.y - s.dy) * s.scale) /h;
  170. this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x, y));
  171. this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y));
  172. this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y - 1));
  173. this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y - 1));
  174. this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y));
  175. };
  176. /**
  177. * Function: roundrect
  178. *
  179. * Private helper function to create SVG elements
  180. */
  181. mxVsdxCanvas2D.prototype.roundrect = function(x, y, w, h, dx, dy)
  182. {
  183. this.rect(x, y, w, h);
  184. //TODO this assume dx and dy are equal and only one rounding is needed
  185. this.shape.appendChild(this.createCellElemScaled("Rounding", dx));
  186. };
  187. /**
  188. * Function: ellipse
  189. *
  190. * Private helper function to create SVG elements
  191. */
  192. mxVsdxCanvas2D.prototype.ellipse = function(x, y, w, h)
  193. {
  194. if (this.geoStepIndex > 1) this.createGeoSec();
  195. var s = this.state;
  196. w = w * s.scale;
  197. h = h * s.scale;
  198. var geo = this.xmGeo;
  199. var gh = geo.height * s.scale;
  200. var gw = geo.width * s.scale;
  201. x = (x - geo.x + s.dx) * s.scale;
  202. y = gh + (-y + geo.y - s.dy) * s.scale;
  203. var hr = h/gh;
  204. var wr = w/gw;
  205. this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x/gw, y/gh - hr * 0.5));
  206. var row = this.createRowRel("RelEllipticalArcTo", this.geoStepIndex++, x/gw, y/gh - hr * 0.5001, wr * 0.5 + x/gw, y/gh - hr, 0);
  207. row.appendChild(this.createCellElem("D", w/h, "Width/Height*"+(wr/hr)));
  208. this.geoSec.appendChild(row);
  209. };
  210. /**
  211. * Function: moveTo
  212. *
  213. * Moves the current path the given point.
  214. *
  215. * Parameters:
  216. *
  217. * x - Number that represents the x-coordinate of the point.
  218. * y - Number that represents the y-coordinate of the point.
  219. */
  220. mxVsdxCanvas2D.prototype.moveTo = function(x, y)
  221. {
  222. this.lastMoveToX = x;
  223. this.lastMoveToY = y;
  224. this.lastX = x;
  225. this.lastY = y;
  226. var geo = this.xmGeo;
  227. var s = this.state;
  228. x = (x - geo.x + s.dx) * s.scale;
  229. y = (geo.height - y + geo.y - s.dy) * s.scale;
  230. var h = geo.height * s.scale;
  231. var w = geo.width * s.scale;
  232. this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x/w, y/h));
  233. };
  234. /**
  235. * Function: lineTo
  236. *
  237. * Draws a line to the given coordinates.
  238. *
  239. * Parameters:
  240. *
  241. * x - Number that represents the x-coordinate of the endpoint.
  242. * y - Number that represents the y-coordinate of the endpoint.
  243. */
  244. mxVsdxCanvas2D.prototype.lineTo = function(x, y)
  245. {
  246. this.lastX = x;
  247. this.lastY = y;
  248. var geo = this.xmGeo;
  249. var s = this.state;
  250. x = (x - geo.x + s.dx) * s.scale;
  251. y = (geo.height - y + geo.y - s.dy) * s.scale;
  252. var h = geo.height * s.scale;
  253. var w = geo.width * s.scale;
  254. this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x/w, y/h));
  255. };
  256. /**
  257. * Function: quadTo
  258. *
  259. * Adds a quadratic curve to the current path.
  260. *
  261. * Parameters:
  262. *
  263. * x1 - Number that represents the x-coordinate of the control point.
  264. * y1 - Number that represents the y-coordinate of the control point.
  265. * x2 - Number that represents the x-coordinate of the endpoint.
  266. * y2 - Number that represents the y-coordinate of the endpoint.
  267. */
  268. mxVsdxCanvas2D.prototype.quadTo = function(x1, y1, x2, y2)
  269. {
  270. this.lastX = x2;
  271. this.lastY = y2;
  272. var s = this.state;
  273. var geo = this.xmGeo;
  274. var h = geo.height * s.scale;
  275. var w = geo.width * s.scale;
  276. x1 = (x1 - geo.x + s.dx) * s.scale;
  277. y1 = (geo.height - y1 + geo.y - s.dy) * s.scale;
  278. x2 = (x2 - geo.x + s.dx) * s.scale;
  279. y2 = (geo.height - y2 + geo.y - s.dy) * s.scale;
  280. x1 = x1 / w;
  281. y1 = y1 / h;
  282. x2 = x2 / w;
  283. y2 = y2 / h;
  284. this.geoSec.appendChild(this.createRowRel("RelQuadBezTo", this.geoStepIndex++, x2, y2, x1, y1));
  285. };
  286. /**
  287. * Function: curveTo
  288. *
  289. * Adds a bezier curve to the current path.
  290. *
  291. * Parameters:
  292. *
  293. * x1 - Number that represents the x-coordinate of the first control point.
  294. * y1 - Number that represents the y-coordinate of the first control point.
  295. * x2 - Number that represents the x-coordinate of the second control point.
  296. * y2 - Number that represents the y-coordinate of the second control point.
  297. * x3 - Number that represents the x-coordinate of the endpoint.
  298. * y3 - Number that represents the y-coordinate of the endpoint.
  299. */
  300. mxVsdxCanvas2D.prototype.curveTo = function(x1, y1, x2, y2, x3, y3)
  301. {
  302. this.lastX = x3;
  303. this.lastY = y3;
  304. var s = this.state;
  305. var geo = this.xmGeo;
  306. var h = geo.height * s.scale;
  307. var w = geo.width * s.scale;
  308. x1 = (x1 - geo.x + s.dx) * s.scale;
  309. y1 = (geo.height - y1 + geo.y - s.dy) * s.scale;
  310. x2 = (x2 - geo.x + s.dx) * s.scale;
  311. y2 = (geo.height - y2 + geo.y - s.dy) * s.scale;
  312. x3 = (x3 - geo.x + s.dx) * s.scale;
  313. y3 = (geo.height - y3 + geo.y - s.dy) * s.scale;
  314. x1 = x1 / w;
  315. y1 = y1 / h;
  316. x2 = x2 / w;
  317. y2 = y2 / h;
  318. x3 = x3 / w;
  319. y3 = y3 / h;
  320. this.geoSec.appendChild(this.createRowRel("RelCubBezTo", this.geoStepIndex++, x3, y3, x1, y1, x2, y2));
  321. };
  322. /**
  323. * Function: close
  324. *
  325. * Closes the current path.
  326. */
  327. mxVsdxCanvas2D.prototype.close = function()
  328. {
  329. //Closing with a line if last point != last MoveTo point
  330. if (this.lastMoveToX != this.lastX || this.lastMoveToY != this.lastY)
  331. this.lineTo(this.lastMoveToX, this.lastMoveToY);
  332. };
  333. /**
  334. * Function: addForeignData
  335. *
  336. * Add ForeignData to current shape using last image in the images array
  337. */
  338. mxVsdxCanvas2D.prototype.addForeignData = function(type, index)
  339. {
  340. var foreignData = this.xmlDoc.createElement("ForeignData");
  341. foreignData.setAttribute("ForeignType", "Bitmap");
  342. type = type.toUpperCase();
  343. if (type != "BMP")
  344. foreignData.setAttribute("CompressionType", type);
  345. var rel = this.xmlDoc.createElement("Rel");
  346. rel.setAttribute("r:id", "rId" + index);
  347. foreignData.appendChild(rel);
  348. this.shape.appendChild(foreignData);
  349. this.shapeType = "Foreign";
  350. };
  351. /**
  352. * Function: image
  353. *
  354. * Add image to vsdx file as a media (Foreign Object)
  355. */
  356. mxVsdxCanvas2D.prototype.image = function(x, y, w, h, src, aspect, flipH, flipV)
  357. {
  358. //TODO image reusing, if the same image is used more than once, reuse it. Applicable for URLs specifically (but can also be applied to embedded ones)
  359. var imgName = "image" + (this.images.length + 1) + ".";
  360. var type;
  361. if (src.indexOf("data:") == 0)
  362. {
  363. var p = src.indexOf("base64,");
  364. var base64 = src.substring(p + 7); //7 is the length of "base64,"
  365. type = src.substring(11, p-1); //5 is the length of "data:image/"
  366. imgName += type;
  367. this.zip.file("visio/media/" + imgName, base64, {base64: true});
  368. }
  369. else if (window.XMLHttpRequest) //URL src, fetch it
  370. {
  371. src = this.converter.convert(src);
  372. this.filesLoading++;
  373. var that = this;
  374. var p = src.lastIndexOf(".");
  375. type = src.substring(p+1);
  376. imgName += type;
  377. //The old browsers binary workaround doesn't work with jszip and converting to base64 encoding doesn't work also
  378. var xhr = new XMLHttpRequest();
  379. xhr.open('GET', src, true);
  380. xhr.responseType = 'arraybuffer';
  381. xhr.onreadystatechange = function(e)
  382. {
  383. if (this.readyState == 4 && this.status == 200) {
  384. that.zip.file("visio/media/" + imgName, this.response);
  385. that.filesLoading--;
  386. }
  387. };
  388. xhr.send();
  389. }
  390. this.images.push(imgName);
  391. //TODO can a shape has more than one image?
  392. this.shapeImg = {type: type, id: this.images.length};
  393. //TODO support these!
  394. aspect = (aspect != null) ? aspect : true;
  395. flipH = (flipH != null) ? flipH : false;
  396. flipV = (flipV != null) ? flipV : false;
  397. var s = this.state;
  398. w = w * s.scale;
  399. h = h * s.scale;
  400. var geo = this.xmGeo;
  401. x = (x - geo.x + s.dx) * s.scale;
  402. y = (geo.height - y + geo.y - s.dy) * s.scale;
  403. this.shape.appendChild(this.createCellElemScaled("ImgOffsetX", x));
  404. this.shape.appendChild(this.createCellElemScaled("ImgOffsetY", y - h));
  405. this.shape.appendChild(this.createCellElemScaled("ImgWidth", w));
  406. this.shape.appendChild(this.createCellElemScaled("ImgHeight", h));
  407. // var s = this.state;
  408. // x += s.dx;
  409. // y += s.dy;
  410. //
  411. // if (s.alpha < 1 || s.fillAlpha < 1)
  412. // {
  413. // node.setAttribute('opacity', s.alpha * s.fillAlpha);
  414. // }
  415. //
  416. // var tr = this.state.transform || '';
  417. //
  418. // if (flipH || flipV)
  419. // {
  420. // var sx = 1;
  421. // var sy = 1;
  422. // var dx = 0;
  423. // var dy = 0;
  424. //
  425. // if (flipH)
  426. // {
  427. // sx = -1;
  428. // dx = -w - 2 * x;
  429. // }
  430. //
  431. // if (flipV)
  432. // {
  433. // sy = -1;
  434. // dy = -h - 2 * y;
  435. // }
  436. //
  437. // // Adds image tansformation to existing transform
  438. // tr += 'scale(' + sx + ',' + sy + ')translate(' + (dx * s.scale) + ',' + (dy * s.scale) + ')';
  439. // }
  440. //
  441. // if (tr.length > 0)
  442. // {
  443. // node.setAttribute('transform', tr);
  444. // }
  445. //
  446. // if (!this.pointerEvents)
  447. // {
  448. // node.setAttribute('pointer-events', 'none');
  449. // }
  450. };
  451. /**
  452. * Function: text
  453. *
  454. * Paints the given text. Possible values for format are empty string for
  455. * plain text and html for HTML markup. Background and border color as well
  456. * as clipping is not available in plain text labels for VML. HTML labels
  457. * are not available as part of shapes with no foreignObject support in SVG
  458. * (eg. IE9, IE10).
  459. *
  460. * Parameters:
  461. *
  462. * x - Number that represents the x-coordinate of the text.
  463. * y - Number that represents the y-coordinate of the text.
  464. * w - Number that represents the available width for the text or 0 for automatic width.
  465. * h - Number that represents the available height for the text or 0 for automatic height.
  466. * str - String that specifies the text to be painted.
  467. * align - String that represents the horizontal alignment.
  468. * valign - String that represents the vertical alignment.
  469. * wrap - Boolean that specifies if word-wrapping is enabled. Requires w > 0.
  470. * format - Empty string for plain text or 'html' for HTML markup.
  471. * overflow - Specifies the overflow behaviour of the label. Requires w > 0 and/or h > 0.
  472. * clip - Boolean that specifies if the label should be clipped. Requires w > 0 and/or h > 0.
  473. * rotation - Number that specifies the angle of the rotation around the anchor point of the text.
  474. * dir - Optional string that specifies the text direction. Possible values are rtl and lrt.
  475. */
  476. mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, format, overflow, clip, rotation, dir)
  477. {
  478. if (this.textEnabled && str != null)
  479. {
  480. if (mxUtils.isNode(str))
  481. {
  482. str = mxUtils.getOuterHtml(str);
  483. }
  484. //TODO support HTML text formatting and remaining attributes
  485. if (this.cellState.style['html'] == '1')
  486. {
  487. if (mxUtils.getValue(this.cellState.style, 'nl2Br', '1') != '0')
  488. {
  489. // Removes newlines from HTML and converts breaks to newlines
  490. // to match the HTML output in plain text
  491. str = str.replace(/\n/g, '').replace(/<br\s*.?>/g, '\n');
  492. }
  493. // Removes HTML tags
  494. if (this.html2txtDiv == null)
  495. this.html2txtDiv = document.createElement('div');
  496. this.html2txtDiv.innerHTML = str;
  497. str = mxUtils.extractTextWithWhitespace(this.html2txtDiv.childNodes);
  498. }
  499. var s = this.state;
  500. var geo = this.xmGeo;
  501. var strRect;
  502. // if (h == 0 || w == 0)
  503. // {
  504. // strRect = mxUtils.getSizeForString(str);
  505. // }
  506. // h = h > 0 ? h : strRect.height;
  507. // w = w > 0 ? w : strRect.width;
  508. h = h > 0 ? h : geo.height;
  509. w = w > 0 ? w : geo.width;
  510. w = w * s.scale;
  511. h = h * s.scale;
  512. x = (x - geo.x + s.dx) * s.scale;
  513. y = (geo.height - y + geo.y - s.dy) * s.scale;
  514. var hw = w/2, hh = h/2;
  515. this.shape.appendChild(this.createCellElemScaled("TxtPinX", x));
  516. this.shape.appendChild(this.createCellElemScaled("TxtPinY", y));
  517. this.shape.appendChild(this.createCellElemScaled("TxtWidth", w));
  518. this.shape.appendChild(this.createCellElemScaled("TxtHeight", h));
  519. this.shape.appendChild(this.createCellElemScaled("TxtLocPinX", hw));
  520. this.shape.appendChild(this.createCellElemScaled("TxtLocPinY", hh));
  521. this.shape.appendChild(this.createCellElemScaled("TxtAngle", rotation * Math.PI / 180));
  522. var text = this.xmlDoc.createElement("Text");
  523. text.textContent = str + "\n";
  524. this.shape.appendChild(text);
  525. //
  526. // var elem = this.createElement('text');
  527. // elem.setAttribute('x', this.format(x));
  528. // elem.setAttribute('y', this.format(y));
  529. // elem.setAttribute('w', this.format(w));
  530. // elem.setAttribute('h', this.format(h));
  531. // elem.setAttribute('str', str);
  532. //
  533. // if (align != null)
  534. // {
  535. // elem.setAttribute('align', align);
  536. // }
  537. //
  538. // if (valign != null)
  539. // {
  540. // elem.setAttribute('valign', valign);
  541. // }
  542. //
  543. // elem.setAttribute('wrap', (wrap) ? '1' : '0');
  544. //
  545. // if (format == null)
  546. // {
  547. // format = '';
  548. // }
  549. //
  550. // elem.setAttribute('format', format);
  551. //
  552. // if (overflow != null)
  553. // {
  554. // elem.setAttribute('overflow', overflow);
  555. // }
  556. //
  557. // if (clip != null)
  558. // {
  559. // elem.setAttribute('clip', (clip) ? '1' : '0');
  560. // }
  561. //
  562. // if (rotation != null)
  563. // {
  564. // elem.setAttribute('rotation', rotation);
  565. // }
  566. //
  567. // if (dir != null)
  568. // {
  569. // elem.setAttribute('dir', dir);
  570. // }
  571. //
  572. // this.root.appendChild(elem);
  573. }
  574. };
  575. /**
  576. * Function: stroke
  577. *
  578. * Paints the outline of the current drawing buffer.
  579. */
  580. mxVsdxCanvas2D.prototype.stroke = function()
  581. {
  582. this.geoSec.appendChild(this.createCellElem("NoFill", "1"));
  583. this.geoSec.appendChild(this.createCellElem("NoLine", "0"));
  584. };
  585. /**
  586. * Function: fill
  587. *
  588. * Fills the current drawing buffer.
  589. */
  590. mxVsdxCanvas2D.prototype.fill = function()
  591. {
  592. this.geoSec.appendChild(this.createCellElem("NoFill", "0"));
  593. this.geoSec.appendChild(this.createCellElem("NoLine", "1"));
  594. };
  595. /**
  596. * Function: fillAndStroke
  597. *
  598. * Fills the current drawing buffer and its outline.
  599. */
  600. mxVsdxCanvas2D.prototype.fillAndStroke = function()
  601. {
  602. this.geoSec.appendChild(this.createCellElem("NoFill", "0"));
  603. this.geoSec.appendChild(this.createCellElem("NoLine", "0"));
  604. };