Skip to content

Commit

Permalink
fix(android): defineMarker/getDefinedMarker storage
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Oct 5, 2019
1 parent 5c5072d commit e6eda84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions android/src/main/java/com/horcrux/svg/SvgView.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ VirtualView getDefinedMask(String maskRef) {
}

void defineMarker(VirtualView marker, String markerRef) {
mDefinedMasks.put(markerRef, marker);
mDefinedMarkers.put(markerRef, marker);
}

VirtualView getDefinedMarker(String markerRef) {
return mDefinedMasks.get(markerRef);
return mDefinedMarkers.get(markerRef);
}
}
6 changes: 3 additions & 3 deletions android/src/main/java/com/horcrux/svg/TSpanView.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private void drawWrappedText(Canvas canvas, Paint paint) {
FontData font = gc.getFont();
TextPaint tp = new TextPaint(paint);
applyTextPropertiesToPaint(tp, font);
applySpacingAndFeatuers(tp, font);
applySpacingAndFeatures(tp, font);
double fontSize = gc.getFontSize();

Layout.Alignment align;
Expand Down Expand Up @@ -225,7 +225,7 @@ Path getPath(Canvas canvas, Paint paint) {
FontData font = gc.getFont();
applyTextPropertiesToPaint(paint, font);

applySpacingAndFeatuers(paint, font);
applySpacingAndFeatures(paint, font);

cachedAdvance = paint.measureText(line);
return cachedAdvance;
Expand All @@ -237,7 +237,7 @@ Path getPath(Canvas canvas, Paint paint) {
final static String additionalLigatures = "'hlig', 'cala', ";
final static String fontWeightTag = "'wght' ";

private void applySpacingAndFeatuers(Paint paint, FontData font) {
private void applySpacingAndFeatures(Paint paint, FontData font) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
double letterSpacing = font.letterSpacing;
paint.setLetterSpacing((float) (letterSpacing / (font.fontSize * mScale)));
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/horcrux/svg/VirtualView.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ abstract public class VirtualView extends ReactViewGroup {
Path mFillPath;
Path mStrokePath;
Path mMarkerPath;
Path mClipRegionPath;
RectF mBox;
RectF mFillBounds;
RectF mStrokeBounds;
Expand All @@ -101,7 +102,6 @@ abstract public class VirtualView extends ReactViewGroup {
Region mMarkerRegion;
Region mStrokeRegion;
Region mClipRegion;
Path mClipRegionPath;
ArrayList<PathElement> elements;

@Override
Expand Down

0 comments on commit e6eda84

Please sign in to comment.