mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 01:44:44 -04:00
add opacity to svg-export
This commit is contained in:
parent
7f7dd18595
commit
f86e9b7693
@ -109,7 +109,7 @@ public class GraphicSVG implements Graphic, Closeable {
|
|||||||
// if (style.isDashed())
|
// if (style.isDashed())
|
||||||
// addStrokeDash(w, style.getDashArray());
|
// addStrokeDash(w, style.getDashArray());
|
||||||
if (style.isFilled() && p.isClosed())
|
if (style.isFilled() && p.isClosed())
|
||||||
w.write(" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"" + getColor(style) + "\"/>\n");
|
w.write(" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"" + getColor(style) + "\" fill-opacity=\""+getOpacity(style)+"\"/>\n");
|
||||||
else
|
else
|
||||||
w.write(" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"none\"/>\n");
|
w.write(" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"none\"/>\n");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -203,6 +203,12 @@ public class GraphicSVG implements Graphic, Closeable {
|
|||||||
return "#" + Integer.toHexString(style.getColor().getRGB()).substring(2);
|
return "#" + Integer.toHexString(style.getColor().getRGB()).substring(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getOpacity(Style style) {
|
||||||
|
double op = style.getColor().getAlpha() / 255.0;
|
||||||
|
return Double.toString(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a given string to XML
|
* Escapes a given string to XML
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user