1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-28 15:09:01 +00:00

Pass a StringBounder into UGraphicTikz

This commit is contained in:
matthew16550 2021-10-03 04:31:42 +11:00
parent 4c3b0bd989
commit ff53f679ef
3 changed files with 8 additions and 8 deletions

View File

@ -98,7 +98,7 @@ public class GraphicsSudoku {
}
public ImageData writeImageLatex(OutputStream os, FileFormat fileFormat) throws IOException {
final UGraphicTikz ug = new UGraphicTikz(HColorUtils.WHITE, new ColorMapperIdentity(), 1,
final UGraphicTikz ug = new UGraphicTikz(HColorUtils.WHITE, new ColorMapperIdentity(), FileFormat.LATEX.getDefaultStringBounder(), 1,
fileFormat == FileFormat.LATEX, TikzFontDistortion.getDefault());
drawInternal(ug);
ug.writeToStream(os, null, -1); // dpi param is not used

View File

@ -418,9 +418,9 @@ public class ImageBuilder {
case VDX:
return new UGraphicVdx(backcolor, colorMapper);
case LATEX:
return new UGraphicTikz(backcolor, colorMapper, scaleFactor, true, option.getTikzFontDistortion());
return new UGraphicTikz(backcolor, colorMapper, FileFormat.LATEX.getDefaultStringBounder(option.getTikzFontDistortion()), scaleFactor, true, option.getTikzFontDistortion());
case LATEX_NO_PREAMBLE:
return new UGraphicTikz(backcolor, colorMapper, scaleFactor, false, option.getTikzFontDistortion());
return new UGraphicTikz(backcolor, colorMapper, FileFormat.LATEX.getDefaultStringBounder(option.getTikzFontDistortion()), scaleFactor, false, option.getTikzFontDistortion());
case BRAILLE_PNG:
return new UGraphicBraille(backcolor, colorMapper);
case UTXT:

View File

@ -37,10 +37,10 @@ package net.sourceforge.plantuml.ugraphic.tikz;
import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.legacy.AtomText;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.tikz.TikzGraphics;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
@ -60,16 +60,16 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements ClipContainer {
private UGraphicTikz(HColor defaultBackground, ColorMapper colorMapper, TikzGraphics tikz,
private UGraphicTikz(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, TikzGraphics tikz,
TikzFontDistortion tikzFontDistortion) {
super(defaultBackground, colorMapper, FileFormat.LATEX.getDefaultStringBounder(tikzFontDistortion), tikz);
super(defaultBackground, colorMapper, stringBounder, tikz);
register();
}
public UGraphicTikz(HColor defaultBackground, ColorMapper colorMapper, double scale, boolean withPreamble,
public UGraphicTikz(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, double scale, boolean withPreamble,
TikzFontDistortion tikzFontDistortion) {
this(defaultBackground, colorMapper, new TikzGraphics(scale, withPreamble), tikzFontDistortion);
this(defaultBackground, colorMapper, stringBounder, new TikzGraphics(scale, withPreamble), tikzFontDistortion);
}