Skip to content

Commit d394513

Browse files
committed
Update to 3.0.2
1 parent 0450d40 commit d394513

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

samples/UIReferenceImplementation/src/main/java/com/myscript/iink/uireferenceimplementation/Canvas.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
import com.myscript.iink.graphics.Style;
3131
import com.myscript.iink.graphics.Transform;
3232

33-
import java.util.HashSet;
33+
import java.util.List;
34+
import java.util.ArrayList;
3435
import java.util.Map;
3536
import java.util.Objects;
36-
import java.util.Set;
3737

3838
public class Canvas implements ICanvas
3939
{
@@ -80,7 +80,7 @@ public class Canvas implements ICanvas
8080

8181
private boolean clearOnStartDraw = true;
8282

83-
private final Set<String> clips;
83+
private final List<String> clips;
8484

8585
private final Map<String, Typeface> typefaceMap;
8686

@@ -104,7 +104,7 @@ public Canvas(@Nullable android.graphics.Canvas canvas, Map<String, Typeface> ty
104104
this.xdpi = xdpi;
105105
this.ydpi = ydpi;
106106

107-
clips = new HashSet<>();
107+
clips = new ArrayList<String>();
108108

109109
strokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
110110
strokePaint.setStyle(Paint.Style.STROKE);
@@ -367,10 +367,12 @@ public void startGroup(@NonNull String id, float x, float y, float width, float
367367
@Override
368368
public void endGroup(@NonNull String id)
369369
{
370-
if (clips.remove(id))
370+
int index = clips.lastIndexOf(id);
371+
if (index != -1)
371372
{
372373
Objects.requireNonNull(canvas);
373374
canvas.restore();
375+
clips.remove(index);
374376
}
375377
}
376378

samples/UIReferenceImplementation/src/main/java/com/myscript/iink/uireferenceimplementation/FontMetricsProvider.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.text.style.MetricAffectingSpan;
2020
import android.text.style.TextAppearanceSpan;
2121
import android.util.DisplayMetrics;
22+
import android.util.TypedValue;
2223

2324
import androidx.annotation.NonNull;
2425
import androidx.collection.LruCache;
@@ -88,11 +89,6 @@ public FontMetricsProvider(DisplayMetrics displayMetrics, Map<String, Typeface>
8889
this.typefaceMap = typefaceMap;
8990
}
9091

91-
private float x_mm2px(float mm)
92-
{
93-
return (mm / 25.4f) * displayMetrics.xdpi;
94-
}
95-
9692
private float y_mm2px(float mm)
9793
{
9894
return (mm / 25.4f) * displayMetrics.ydpi;
@@ -127,7 +123,7 @@ public Rectangle[] getCharacterBoundingBoxes(@NonNull Text text, TextSpan[] span
127123
@Override
128124
public float getFontSizePx(Style style)
129125
{
130-
return style.getFontSize() * displayMetrics.scaledDensity;
126+
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, style.getFontSize(), displayMetrics);
131127
}
132128

133129
@Override

samples/buildSrc/src/main/java/Dependencies.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ object Versions {
2727

2828
// 3rd party
2929
const val gson = "2.10.1"
30+
const val okhttp = "4.11.0"
3031
}

samples/settings.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
rootProject.name = 'myscript.iink.samples.android.java'
77

8-
gradle.ext.iinkVersionCode = 2310
9-
gradle.ext.iinkVersionName = "2.3.1"
10-
gradle.ext.iinkResourcesURL = "https://download.myscript.com/iink/recognitionAssets_iink_2.3"
8+
gradle.ext.iinkVersionCode = 3020
9+
gradle.ext.iinkVersionName = "3.0.2"
10+
gradle.ext.iinkResourcesURL = "https://download.myscript.com/iink/recognitionAssets_iink_3.0"
1111

1212
def projects = [
1313
// samples

0 commit comments

Comments
 (0)