misohena / el-easydraw

Embedded drawing tool for Emacs
https://misohena.jp/blog/2021-09-21-emacs-easy-draw.html
GNU General Public License v3.0
769 stars 21 forks source link

Fixes #25 zoom scroll imported image #26

Closed TobiasZawada closed 8 months ago

TobiasZawada commented 8 months ago

Wrap the old contents of the imported SVG with group edraw-body instead of adding an empty group edraw-body.

Dear @misohena , this is just a suggestion you can improve it or change it to your liking.

An interesting alternative would be using the viewport-attribute of the SVG image to scroll and scale the view instead of the transformation of group edraw-body.

TobiasZawada commented 8 months ago

@misohena Thanks for the effort. I think in the current state an SVG-importer could even be a separate project. This would take some work load and responsibility from your shoulders.

One could make clear to the user that the importer is very limited and the edraw-images could be partially faulty/unsupported. Feature requests for the importer could point to possible directions of improvement for edraw.

Best regards, Tobias

misohena commented 8 months ago

@TobiasZawada Hi, Tobias

Although it is still under construction, I have added edraw-import.el. M-x edraw-convert-buffer-to-edraw-svg-xml can convert the SVG in the current buffer to one for edraw. I've been wanting to read SVG generated with Graphviz for a while now, so I made it. Convert polyline and polygon to path, and circle to ellipse.

The check for unsupported elements is still lax, so I think I'll fix it a little more.

(Original Message) まだ作り途中ですが edraw-import.el というのを追加しました。 M-x edraw-convert-buffer-to-edraw-svg-xml で現在のバッファのSVGをedraw用のものへ変換できます。 前々からGraphvizで生成したSVGを読み込みたいと思っていたので作ってみました。 polylineやpolygonはpathへ、circleはellipseへ変換します。

まだチェックが甘いので、もう少し修正すると思います。