mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 14:31:02 -04:00
Fixed to small bounding boxes in svg graphics.
This commit is contained in:
parent
10f58ffb05
commit
7fbc46323c
@ -63,12 +63,13 @@ public class GraphicSVG implements Graphic, Closeable {
|
||||
+ " xmlns:svg=\"http://www.w3.org/2000/svg\"\n"
|
||||
+ " xmlns=\"http://www.w3.org/2000/svg\"\n");
|
||||
|
||||
double width = (max.x - min.x) * svgScale / 100.0;
|
||||
double height = (max.y - min.y) * svgScale / 100.0;
|
||||
double width = (max.x - min.x + Style.MAXLINETHICK) * svgScale / 100.0;
|
||||
double height = (max.y - min.y + Style.MAXLINETHICK) * svgScale / 100.0;
|
||||
|
||||
final int lineCorr = Style.MAXLINETHICK / 2;
|
||||
w.write(" width=\"" + width + "mm\"\n"
|
||||
+ " height=\"" + height + "mm\"\n"
|
||||
+ " viewBox=\"" + min.x + " " + min.y + " " + (max.x - min.x) + " " + (max.y - min.y) + "\">\n");
|
||||
+ " viewBox=\"" + (min.x - lineCorr) + " " + (min.y - lineCorr) + " " + (max.x - min.x + Style.MAXLINETHICK) + " " + (max.y - min.y + Style.MAXLINETHICK) + "\">\n");
|
||||
w.write("<g stroke-linecap=\"square\">\n");
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,14 @@ import java.awt.*;
|
||||
* @author hneemann
|
||||
*/
|
||||
public class Style {
|
||||
private static final int WIRETHICK = 4;
|
||||
private static final int LINETHICK = 4;
|
||||
private static final int LINETHIN = 2;
|
||||
/**
|
||||
* maximal line thickness
|
||||
*/
|
||||
public static final int MAXLINETHICK = 4;
|
||||
|
||||
private static final int WIRETHICK = MAXLINETHICK;
|
||||
private static final int LINETHICK = MAXLINETHICK;
|
||||
private static final int LINETHIN = MAXLINETHICK / 2;
|
||||
private static final int LINEDASH = 1;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user