Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Add permissive certs to work around zscaler issue

AuthorDaveJarvis <email>
Date2021-05-16 14:48:43 GMT-0700
Commit0c19858d62b9912b9fb6f58ea92a799ed800d707
Parent8ab5b7b
Delta6 lines added, 7 lines removed, 1-line decrease
src/main/java/com/keenwrite/preview/HtmlPreview.java
private volatile boolean mLocked;
private final JButton mScrollLockButton = new JButton();
-
private final Workspace mWorkspace;
public HtmlPreview( final Workspace workspace ) {
mWorkspace = workspace;
- mFactory = new ChainedReplacedElementFactory(
+ mFactory = new ChainedReplacedElementFactory(
mWorkspace,
new SvgReplacedElementFactory(),
src/main/java/com/keenwrite/preview/SmoothImageReplacedElement.java
/**
* Creates a high-quality rescaled version of the given image. The
- * aspect ratio is preserved if either width or height is less than 1.
+ * aspect ratio is maintained if either width or height is less than 1.
*
* @param source An instance of {@link BufferedImage} to rescale.
private Dimension rescaleDimensions(
final BufferedImage bi, final int width, final int height ) {
- final var w = bi.getWidth();
- final var h = bi.getHeight();
+ final var oldW = bi.getWidth();
+ final var oldH = bi.getHeight();
int newW = width;
int newH = height;
if( newW <= 0 ) {
- newW = (int) (w * ((double) newH / h));
+ newW = (int) (oldW * ((double) newH / oldH));
}
if( newH <= 0 ) {
- newH = (int) (h * ((double) newW / w));
+ newH = (int) (oldH * ((double) newW / oldW));
}