ivanceras / svgbob

Convert your ascii diagram scribbles into happy little SVG
http://ivanceras.github.io/svgbob-editor/
Apache License 2.0
3.83k stars 108 forks source link

Triangle filling is not working #92

Open kingelilol opened 2 years ago

kingelilol commented 2 years ago

Hi,

I've tried to fill a triangle, but it does not work.

This is my testcase:

+---+ +-----+ + +---------+ +
|{r}|  \{r}/ / \ \       / / \
+---+   \ / /{r}\ \ {r} / /   \
         + +-----+ \   / / {r} \
+-----+             \ / /       \
|     |              + +---------+
| {r} |
|     |
+-----+

# Legend:
r = {
    fill: red;
}

test

ivanceras commented 2 years ago

This is not yet supported, tagged shapes with css is only applied to rectangles and circles for now.

hfiguiere commented 9 months ago

I guess that the same issue with

 +-----+------+
 |G {g}| B {b}|
 +-----+------+
 | {r} | {g}  |
 +-----+------+

 +---+
 |{g}|
 +---+

# Legend:
r = {
    stroke: red;
    fill: red;
}
g = {
    fill: green;
}
b = {
    fill: blue;
}

Which gives image

ivanceras commented 9 months ago

The tagging is limited only to a detached limited shape primitives such as circle and rect. If it is touching or very close or inside another shape, the algorithm breaks.