![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.klimt.compress.CompressionTransform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.klimt.compress;
import java.util.List;
public class CompressionTransform implements PiecewiseAffineTransform {
// ::remove file when __HAXE__
private final List all;
public CompressionTransform(SlotSet slotSet) {
this.all = slotSet.getSlots();
}
public double transform(double v) {
return v - getCompressDelta(v);
}
private double getCompressDelta(double v) {
double result = 0;
for (Slot s : all) {
if (s.getStart() > v) {
continue;
}
if (v > s.getEnd()) {
result += s.size();
} else {
result += v - s.getStart();
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy