Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #160 from cdk/feature/depict
A few minor comments which can be applied later.
  • Loading branch information
egonw committed Sep 26, 2015
2 parents 5be3cb1 + 202cbfe commit ad921ba
Show file tree
Hide file tree
Showing 7 changed files with 1,340 additions and 143 deletions.
15 changes: 13 additions & 2 deletions app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java
Expand Up @@ -50,6 +50,17 @@
@SuppressWarnings("PMD.ShortVariable")
public abstract class Depiction {

/**
* For converting MM coordinates to PS Point (1/72 inch)
*/
protected static final double MM_TO_POINT = 2.83464566751;

/**
* When no fixed padding value is specified we use margin
* multiplied by this value.
*/
protected static final double DEFAULT_PADDING_FACTOR = 2;

/**
* Structured Vector Graphics (SVG) format key.
*/
Expand Down Expand Up @@ -226,7 +237,7 @@ public final void writeTo(String fmt, File file) throws IOException {
* @see #listFormats()
*/
public final void writeTo(String fmt, String path) throws IOException {
writeTo(fmt, new File(replaceTildaWithHomeDir(ensureSuffix(path, fmt))));
writeTo(fmt, new File(replaceTildeWithHomeDir(ensureSuffix(path, fmt))));
}

/**
Expand All @@ -252,7 +263,7 @@ public final void writeTo(String path) throws IOException {
* @param path the file system path
* @return normalised path
*/
private static String replaceTildaWithHomeDir(String path) {
private static String replaceTildeWithHomeDir(String path) {
if (path.startsWith("~/"))
return System.getProperty("user.home") + path.substring(1);
return path;
Expand Down

0 comments on commit ad921ba

Please sign in to comment.