Skip to content

Commit bb22157

Browse files
fandwcandillon
andauthored
fix: use TextDecorationStyle for SkTextStyle.decorationStyle (#2628)
--------- Co-authored-by: William Candillon <[email protected]>
1 parent 1d6614a commit bb22157

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

apps/paper/src/Examples/API/Paragraphs.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Rect,
1212
Skia,
1313
TextDecoration,
14+
TextDecorationStyle,
1415
mix,
1516
useFonts,
1617
} from "@shopify/react-native-skia";
@@ -92,8 +93,8 @@ export const Paragraphs = () => {
9293
],
9394
decorationColor: Skia.Color("#00223A"),
9495
decorationThickness: 2,
95-
decoration: 1,
96-
decorationStyle: TextDecoration.Overline,
96+
decoration: TextDecoration.Underline,
97+
decorationStyle: TextDecorationStyle.Dotted,
9798
};
9899

99100
paragraphBuilder

packages/skia/src/skia/types/Paragraph/TextStyle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export enum TextBaseline {
5050
export interface SkTextStyle {
5151
backgroundColor?: SkColor;
5252
color?: SkColor;
53-
decoration?: number;
53+
decoration?: TextDecoration;
5454
decorationColor?: SkColor;
5555
decorationThickness?: number;
56-
decorationStyle?: TextDecoration;
56+
decorationStyle?: TextDecorationStyle;
5757
fontFamilies?: string[];
5858
fontFeatures?: SkTextFontFeatures[];
5959
fontSize?: number;

0 commit comments

Comments
 (0)