From ff6984df00f3376a29aeb89da7b04dde3f5ee1a3 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Mon, 10 Jan 2022 22:06:26 +0000 Subject: remove and prevent links to stackoverflow git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896899 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hemf/record/emfplus/HemfPlusBrush.java | 31 ---------------------- .../org/apache/poi/hwmf/draw/HwmfGraphics.java | 2 -- 2 files changed, 33 deletions(-) (limited to 'poi-scratchpad/src') diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusBrush.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusBrush.java index 0e02d12e8e..e713254e9e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusBrush.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusBrush.java @@ -677,37 +677,6 @@ public class HemfPlusBrush { Color inter = DrawPaint.SCRGB2RGB(r,g,b); return new Color(inter.getRed(), inter.getGreen(), inter.getBlue(), a); } - - /* - private Color interpolateColorsHSL(final double factor) { - final double[] hslStart = DrawPaint.RGB2HSL(startColor); - final double[] hslStop = DrawPaint.RGB2HSL(endColor); - - BiFunction linearInter = (start, stop) -> - start.doubleValue()+(stop.doubleValue()-start.doubleValue())*factor; - - double alpha = linearInter.apply(startColor.getAlpha(),endColor.getAlpha()); - double sat = linearInter.apply(hslStart[1],hslStop[1]); - double lum = linearInter.apply(hslStart[2],hslStop[2]); - - // find closest match - decide if need to go clockwise or counter-clockwise - // https://stackoverflow.com/questions/1416560/hsl-interpolation - double hueMidCW = (hslStart[0]+hslStop[0])/2.; - double hueMidCCW = (hslStart[0]+hslStop[0]+360.)/2.; - - Function hueDelta = (hue) -> - Math.min(Math.abs(hslStart[0]-hue), Math.abs(hslStop[0]-hue)); - - double hslDiff; - if (hueDelta.apply(hueMidCW) > hueDelta.apply(hueMidCCW)) { - hslDiff = (hslStart[0] < hslStop[0]) ? hslStop[0]-hslStart[0] : (360-hslStart[0])+hslStop[0]; - } else { - hslDiff = (hslStart[0] < hslStop[0]) ? -hslStart[0]-(360-hslStop[0]) : -(hslStart[0]-hslStop[0]); - } - double hue = (hslStart[0]+hslDiff*factor)%360.; - - return DrawPaint.HSL2RGB(hue, sat, lum, alpha/255.); - } */ } /** The EmfPlusPathGradientBrushData object specifies a path gradient for a graphics brush. */ diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/draw/HwmfGraphics.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/draw/HwmfGraphics.java index 701ab2d54e..ecfe21f544 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/draw/HwmfGraphics.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/draw/HwmfGraphics.java @@ -619,8 +619,6 @@ public class HwmfGraphics implements HwmfCharsetAware { // TODO: fix font height calculation // the height is given as font size + ascent + descent // as an approximation we reduce the height by a static factor - // - // see https://stackoverflow.com/a/26564924/2066598 on to get the font size from the cell height return fontHeight*3/4; } } -- cgit v1.2.3