Skip to content

Commit

Permalink
Back out "Implement stroke style"
Browse files Browse the repository at this point in the history
Summary: Back out "[IG4A][Native Text Overlay V2] Implement stroke style"

Reviewed By: pasqualeanatriello

Differential Revision: D68498080

fbshipit-source-id: 1875eba38d82f6634d4853c7b166a9b6b28f5e2d
  • Loading branch information
adityasharat authored and facebook-github-bot committed Jan 22, 2025
1 parent 1198397 commit ebfea3a
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public class RCTextView extends View {
private boolean mShouldHandleTouch;
private boolean mShouldHandleKeyEvents;
@Nullable private Integer mWasFocusable;
private int mStrokeColor;
private float mStrokeWidth;

public RCTextView(Context context) {
super(context);
Expand Down Expand Up @@ -183,9 +181,6 @@ public void draw(@NonNull Canvas canvas) {
}

private void drawLayout(Canvas canvas) {
if (shouldDrawStrokeStyle()) {
drawStrokeStyle(canvas);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
Api34Utils.draw(mLayout, canvas, getSelectionPath(), mHighlightPaint);
} else {
Expand All @@ -194,29 +189,6 @@ private void drawLayout(Canvas canvas) {
}
}

private boolean shouldDrawStrokeStyle() {
return mStrokeColor != 0 && mStrokeWidth != 0;
}

private void drawStrokeStyle(Canvas canvas) {
if (mLayout == null) {
return;
}
Paint mPaint = mLayout.getPaint();
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(mStrokeColor);
mPaint.setStrokeWidth(mStrokeWidth);
mPaint.setStrokeJoin(Paint.Join.ROUND);
Path path = getSelectionPath();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
Api34Utils.draw(mLayout, canvas, path, mHighlightPaint);
} else if (path != null) {
mLayout.draw(canvas, path, mHighlightPaint, 0);
}
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mLinkColor);
}

private OnPrePostDrawSpan[] getOnPrePostDrawSpans() {
if (!(mText instanceof Spanned)) {
return new OnPrePostDrawSpan[0];
Expand Down Expand Up @@ -254,8 +226,6 @@ public void mount(TextLayout textLayout) {
.setColor(mColorStateList.getColorForState(getDrawableState(), mLinkColor));
}
}
mStrokeColor = textLayout.textStyle.strokeColor;
mStrokeWidth = textLayout.textStyle.strokeWidth;

if (highlightOffsetsValid(
mText,
Expand Down

0 comments on commit ebfea3a

Please sign in to comment.