mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 00:44:40 -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())
|
||||
// addStrokeDash(w, style.getDashArray());
|
||||
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
|
||||
w.write(" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"none\"/>\n");
|
||||
} catch (IOException e) {
|
||||
@ -203,6 +203,12 @@ public class GraphicSVG implements Graphic, Closeable {
|
||||
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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user