1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-29 07:29:00 +00:00

Merge pull request #1215 from barskern/add-scale-to-tikz-picture

Add scale parameter to includegraphics for tikz
This commit is contained in:
PlantUML 2022-12-16 15:13:46 +01:00 committed by GitHub
commit 800ead7a8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques * (C) Copyright 2009-2023, Arnaud Roques
* *
* Project Info: http://plantuml.com * Project Info: http://plantuml.com
* *
* If you like this project or if you find it useful, you can support us at: * If you like this project or if you find it useful, you can support us at:
* *
* http://plantuml.com/patreon (only 1$ per month!) * http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal * http://plantuml.com/paypal
* *
* This file is part of PlantUML. * This file is part of PlantUML.
* *
* PlantUML is free software; you can redistribute it and/or modify it * PlantUML is free software; you can redistribute it and/or modify it
@ -44,8 +44,11 @@ public class DriverImageTikz implements UDriver<UImage, TikzGraphics> {
public void draw(UImage shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) { public void draw(UImage shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
final String rawFileName = shape.getRawFileName(); final String rawFileName = shape.getRawFileName();
// TODO how to get this from the <img:file{scale=?}> parameter?
double scale = 1.0;
if (rawFileName != null) { if (rawFileName != null) {
final String raw = "\\includegraphics{" + rawFileName + "}"; final String raw = "\\includegraphics[scale=" + scale + "]{" + rawFileName + "}";
tikz.appendRaw(x, y, raw); tikz.appendRaw(x, y, raw);
return; return;
} }