drawnui-react 0.1.0-preview.4 → 0.1.0-preview.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -14
- package/SKIPPED.md +36 -26
- package/dist/controls/AnimatedFramesRenderer.d.ts +9 -0
- package/dist/controls/AnimatedFramesRenderer.js +18 -1
- package/dist/controls/DrawnGame.d.ts +44 -0
- package/dist/controls/DrawnGame.js +82 -0
- package/dist/controls/GridStructure.d.ts +16 -2
- package/dist/controls/GridStructure.js +40 -4
- package/dist/controls/SkiaBackdrop.d.ts +8 -2
- package/dist/controls/SkiaBackdrop.js +42 -14
- package/dist/controls/SkiaButton.d.ts +17 -3
- package/dist/controls/SkiaButton.js +26 -8
- package/dist/controls/SkiaCarousel.d.ts +22 -3
- package/dist/controls/SkiaCarousel.js +85 -9
- package/dist/controls/SkiaCheckbox.d.ts +0 -1
- package/dist/controls/SkiaCheckbox.js +2 -7
- package/dist/controls/SkiaDrawer.d.ts +15 -0
- package/dist/controls/SkiaDrawer.js +42 -7
- package/dist/controls/SkiaEditor.d.ts +48 -2
- package/dist/controls/SkiaEditor.js +268 -53
- package/dist/controls/SkiaGif.d.ts +7 -0
- package/dist/controls/SkiaGif.js +25 -4
- package/dist/controls/SkiaImage.d.ts +5 -0
- package/dist/controls/SkiaImage.js +48 -14
- package/dist/controls/SkiaLabel.d.ts +117 -9
- package/dist/controls/SkiaLabel.js +526 -80
- package/dist/controls/SkiaLabelFps.d.ts +16 -0
- package/dist/controls/SkiaLabelFps.js +41 -0
- package/dist/controls/SkiaLayout.d.ts +89 -9
- package/dist/controls/SkiaLayout.js +364 -21
- package/dist/controls/SkiaLottie.js +5 -3
- package/dist/controls/SkiaProgress.d.ts +2 -1
- package/dist/controls/SkiaProgress.js +8 -5
- package/dist/controls/SkiaRadioButton.d.ts +2 -0
- package/dist/controls/SkiaRadioButton.js +16 -4
- package/dist/controls/SkiaRichLabel.d.ts +1 -1
- package/dist/controls/SkiaRichLabel.js +11 -1
- package/dist/controls/SkiaScroll.d.ts +35 -5
- package/dist/controls/SkiaScroll.js +252 -32
- package/dist/controls/SkiaScrollBar.d.ts +27 -0
- package/dist/controls/SkiaScrollBar.js +51 -2
- package/dist/controls/SkiaShaderCarousel.d.ts +11 -1
- package/dist/controls/SkiaShaderCarousel.js +27 -5
- package/dist/controls/SkiaShape.d.ts +13 -2
- package/dist/controls/SkiaShape.js +50 -10
- package/dist/controls/SkiaSlider.d.ts +20 -2
- package/dist/controls/SkiaSlider.js +61 -7
- package/dist/controls/SkiaSprite.d.ts +4 -0
- package/dist/controls/SkiaSprite.js +22 -10
- package/dist/controls/SkiaSvg.d.ts +4 -0
- package/dist/controls/SkiaSvg.js +28 -4
- package/dist/controls/SkiaSwitch.d.ts +0 -1
- package/dist/controls/SkiaSwitch.js +4 -8
- package/dist/controls/SkiaToggle.d.ts +25 -5
- package/dist/controls/SkiaToggle.js +58 -5
- package/dist/controls/SnappingLayout.d.ts +12 -1
- package/dist/controls/SnappingLayout.js +21 -2
- package/dist/controls/TooltipStyle.d.ts +52 -0
- package/dist/controls/TooltipStyle.js +88 -0
- package/dist/core/Accessibility.d.ts +134 -0
- package/dist/core/Accessibility.js +675 -9
- package/dist/core/Animators.d.ts +37 -1
- package/dist/core/Animators.js +102 -9
- package/dist/core/Canvas.d.ts +241 -10
- package/dist/core/Canvas.js +739 -44
- package/dist/core/ControlStyle.d.ts +2 -0
- package/dist/core/ControlStyle.js +2 -0
- package/dist/core/DesignerActions.d.ts +32 -0
- package/dist/core/DesignerActions.js +68 -0
- package/dist/core/Easing.d.ts +12 -1
- package/dist/core/Easing.js +25 -1
- package/dist/core/Gestures.d.ts +81 -2
- package/dist/core/Gestures.js +177 -3
- package/dist/core/Hover.d.ts +51 -0
- package/dist/core/Hover.js +140 -0
- package/dist/core/ImageEffects.d.ts +2 -0
- package/dist/core/ImageEffects.js +2 -0
- package/dist/core/KeyboardManager.d.ts +40 -0
- package/dist/core/KeyboardManager.js +98 -8
- package/dist/core/PopupWindows.d.ts +94 -0
- package/dist/core/PopupWindows.js +205 -0
- package/dist/core/ScrollAnimators.js +9 -0
- package/dist/core/Shaping.d.ts +40 -0
- package/dist/core/Shaping.js +224 -0
- package/dist/core/SkiaControl.d.ts +284 -11
- package/dist/core/SkiaControl.js +630 -66
- package/dist/core/SkiaEffect.d.ts +17 -0
- package/dist/core/SkiaEffect.js +43 -8
- package/dist/core/SkiaImageManager.js +1 -1
- package/dist/core/Super.d.ts +29 -2
- package/dist/core/Super.js +54 -3
- package/dist/core/Tooltips.d.ts +71 -0
- package/dist/core/Tooltips.js +205 -0
- package/dist/core/Types.d.ts +11 -1
- package/dist/core/Types.js +32 -1
- package/dist/core/ViewsAdapter.d.ts +7 -2
- package/dist/core/ViewsAdapter.js +10 -3
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/react/SkiaShell.js +65 -26
- package/dist/react/index.d.ts +51 -4
- package/dist/react/index.js +180 -18
- package/dist/react/reconciler.d.ts +20 -0
- package/dist/react/reconciler.js +69 -14
- package/dist/vite/index.d.ts +9 -0
- package/dist/vite/index.js +36 -3
- package/package.json +66 -2
|
@@ -42,8 +42,8 @@ export class SkiaImage extends SkiaControl {
|
|
|
42
42
|
switch (this.AddEffect) {
|
|
43
43
|
case "Tint": return this.ColorTint !== Colors.Transparent ? SkiaImageEffects.Tint(this.ColorTint, this.EffectBlendMode) : null;
|
|
44
44
|
case "Darken": return this.Darken !== 0 ? SkiaImageEffects.Darken(this.Darken) : null;
|
|
45
|
-
case "BlackAndWhite":
|
|
46
|
-
case "Grayscale": return SkiaImageEffects.
|
|
45
|
+
case "BlackAndWhite": return SkiaImageEffects.Grayscale();
|
|
46
|
+
case "Grayscale": return SkiaImageEffects.Grayscale2();
|
|
47
47
|
case "Pastel": return SkiaImageEffects.Pastel();
|
|
48
48
|
case "Lighten": return this.Lighten !== 0 ? SkiaImageEffects.Lighten(this.Lighten) : null;
|
|
49
49
|
case "Sepia": return SkiaImageEffects.Sepia();
|
|
@@ -140,7 +140,7 @@ export class SkiaImage extends SkiaControl {
|
|
|
140
140
|
if (width * aspectX > dest.Width || height * aspectY > dest.Height)
|
|
141
141
|
aspectX = aspectY = Math.min(s1, s2);
|
|
142
142
|
break;
|
|
143
|
-
case "Tile": break; //
|
|
143
|
+
case "Tile": break; // natural size, repeated over the destination when drawn
|
|
144
144
|
}
|
|
145
145
|
return { X: aspectX, Y: aspectY };
|
|
146
146
|
}
|
|
@@ -164,20 +164,25 @@ export class SkiaImage extends SkiaControl {
|
|
|
164
164
|
MeasureAbsolute(widthConstraint, heightConstraint, scale) {
|
|
165
165
|
const img = this.LoadedSource;
|
|
166
166
|
let w = widthConstraint, h = heightConstraint;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
else if (!isFinite(h) && isFinite(w))
|
|
172
|
-
h = w / aspect;
|
|
167
|
+
// nothing loaded: the box it is offered (C# OnMeasuring), an unbounded side 0
|
|
168
|
+
if (!img) {
|
|
169
|
+
this.AspectScale = { X: 0, Y: 0 };
|
|
170
|
+
return ScaledSize.FromPixels(isFinite(w) ? w : 0, isFinite(h) ? h : 0, scale);
|
|
173
171
|
}
|
|
174
|
-
|
|
172
|
+
const iw = img.width(), ih = img.height();
|
|
173
|
+
if (!isFinite(w) && isFinite(h))
|
|
174
|
+
w = h * iw / ih;
|
|
175
|
+
else if (!isFinite(h) && isFinite(w))
|
|
176
|
+
h = w * ih / iw;
|
|
177
|
+
if (!isFinite(w) || !isFinite(h) || iw <= 0 || ih <= 0) {
|
|
175
178
|
this.AspectScale = { X: 0, Y: 0 };
|
|
176
179
|
return ScaledSize.FromPixels(0, 0, scale);
|
|
177
180
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
// C# OnMeasuring / DrawnUi.Rust: an auto-sized side is the bitmap's pixels scaled by the aspect for this box, never
|
|
182
|
+
// more than the box (a Fill or requested side still takes its box in Measure)
|
|
183
|
+
const s = SkiaImage.RescaleAspect(iw, ih, SKRect.Create(0, 0, w, h), this.Aspect);
|
|
184
|
+
this.AspectScale = s;
|
|
185
|
+
return ScaledSize.FromPixels(Math.min(iw * s.X, w), Math.min(ih * s.Y, h), scale);
|
|
181
186
|
}
|
|
182
187
|
Paint(ctx) {
|
|
183
188
|
const img = this.LoadedSource;
|
|
@@ -213,10 +218,39 @@ export class SkiaImage extends SkiaControl {
|
|
|
213
218
|
paint.setImageFilter(blur);
|
|
214
219
|
if (this.PaintColorFilter)
|
|
215
220
|
paint.setColorFilter(this.PaintColorFilter);
|
|
216
|
-
|
|
221
|
+
if (this.Aspect === "Tile") {
|
|
222
|
+
// C# DrawSourceRegion: the image at its natural size repeats over the whole destination from the aligned copy
|
|
223
|
+
if (!overflows)
|
|
224
|
+
canvas.clipRect(CK.LTRBRect(dest.Left, dest.Top, dest.Right, dest.Bottom), CK.ClipOp.Intersect, true);
|
|
225
|
+
paint.setShader(this.TileShader(img, display));
|
|
226
|
+
canvas.drawRect(CK.LTRBRect(dest.Left, dest.Top, dest.Right, dest.Bottom), paint);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
canvas.drawImageRectOptions(img, CK.LTRBRect(0, 0, img.width(), img.height()), CK.LTRBRect(display.Left, display.Top, display.Right, display.Bottom), CK.FilterMode.Linear, CK.MipmapMode.Linear, paint);
|
|
230
|
+
}
|
|
217
231
|
colorFilter?.delete();
|
|
218
232
|
blur?.delete();
|
|
219
233
|
paint.delete();
|
|
220
234
|
canvas.restoreToCount(saved);
|
|
221
235
|
}
|
|
236
|
+
tileShader;
|
|
237
|
+
tileShaderKey;
|
|
238
|
+
/** Repeat shader of the image placed at `display`, kept until the image or its placement changes (C# cached fill shader). */
|
|
239
|
+
TileShader(img, display) {
|
|
240
|
+
const k = this.tileShaderKey;
|
|
241
|
+
if (this.tileShader && k && k.Image === img && k.Left === display.Left && k.Top === display.Top && k.Width === display.Width && k.Height === display.Height)
|
|
242
|
+
return this.tileShader;
|
|
243
|
+
this.tileShader?.delete();
|
|
244
|
+
const CK = Super.CK, M = CK.Matrix;
|
|
245
|
+
const local = M.multiply(M.translated(display.Left, display.Top), M.scaled(display.Width / img.width(), display.Height / img.height()));
|
|
246
|
+
this.tileShader = img.makeShaderOptions(CK.TileMode.Repeat, CK.TileMode.Repeat, CK.FilterMode.Linear, CK.MipmapMode.None, local);
|
|
247
|
+
this.tileShaderKey = { Image: img, Left: display.Left, Top: display.Top, Width: display.Width, Height: display.Height };
|
|
248
|
+
return this.tileShader;
|
|
249
|
+
}
|
|
250
|
+
OnDisposing() {
|
|
251
|
+
this.tileShader?.delete();
|
|
252
|
+
this.tileShader = undefined;
|
|
253
|
+
this.tileShaderKey = undefined;
|
|
254
|
+
super.OnDisposing();
|
|
255
|
+
}
|
|
222
256
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DrawingContext, SkiaControl } from "../core/SkiaControl";
|
|
2
2
|
import { type GestureEventProcessingInfo, type SkiaGesturesParameters } from "../core/Gestures";
|
|
3
|
-
import { type Color, type DrawTextAlignment, type FontAttributes, type LineBreakMode, ScaledSize, type SkiaGradient, type TextAlignment, type TextTransform, Thickness } from "../core/Types";
|
|
3
|
+
import { type Color, type DrawTextAlignment, type FontAttributes, type LineBreakMode, ScaledSize, type SkiaGradient, type TextAlignment, type TextTransform, Thickness, type ThicknessValue } from "../core/Types";
|
|
4
4
|
import { TextSpan } from "./TextSpan";
|
|
5
5
|
/** One code point of the laid-out text: its UTF-16 index/length in Text and its box in pixels relative to DrawingRect. */
|
|
6
6
|
export interface GlyphBox {
|
|
@@ -10,7 +10,8 @@ export interface GlyphBox {
|
|
|
10
10
|
Left: number;
|
|
11
11
|
Top: number;
|
|
12
12
|
Width: number;
|
|
13
|
-
Height: number;
|
|
13
|
+
Height: number; /** The code point runs right to left (its box is in visual place). */
|
|
14
|
+
Rtl?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/** A laid-out line: first text index, box in pixels relative to DrawingRect. */
|
|
16
17
|
export interface LineBox {
|
|
@@ -43,6 +44,8 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
43
44
|
private verticalTextAlignment;
|
|
44
45
|
private lineSpacing;
|
|
45
46
|
private lineHeight;
|
|
47
|
+
private paragraphSpacing;
|
|
48
|
+
private characterSpacing;
|
|
46
49
|
private textTransform;
|
|
47
50
|
private padding;
|
|
48
51
|
/** Styled fragments; when not empty they replace `Text` (same precedence as C#). */
|
|
@@ -53,6 +56,8 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
53
56
|
protected DefaultAccessibilityLabel(): string | undefined;
|
|
54
57
|
constructor();
|
|
55
58
|
private Set;
|
|
59
|
+
/** A property that changes only the look (a color): no layout change, see UpdateDraw. */
|
|
60
|
+
private SetLook;
|
|
56
61
|
get Text(): string;
|
|
57
62
|
set Text(v: string);
|
|
58
63
|
get FontSize(): number;
|
|
@@ -84,10 +89,24 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
84
89
|
/** Multiplier applied to the natural line height (ascent + descent). */
|
|
85
90
|
get LineHeight(): number;
|
|
86
91
|
set LineHeight(v: number);
|
|
92
|
+
/**
|
|
93
|
+
* Space above every paragraph after the first, in lines (C# ParagraphSpacing; 0 here as DrawnUi.Rust, C# 0.25). A
|
|
94
|
+
* paragraph starts after "\n"; U+2028 breaks the line inside a paragraph.
|
|
95
|
+
*/
|
|
96
|
+
get ParagraphSpacing(): number;
|
|
97
|
+
set ParagraphSpacing(v: number);
|
|
98
|
+
/**
|
|
99
|
+
* C# CharacterSpacing: 1 = the font's own spacing; every glyph is followed by (CharacterSpacing - 1) points more
|
|
100
|
+
* (less below 1), the line measures and wraps at the width it draws (C# 7cf1007c, DrawnUi.Rust label).
|
|
101
|
+
*/
|
|
102
|
+
get CharacterSpacing(): number;
|
|
103
|
+
set CharacterSpacing(v: number);
|
|
87
104
|
get TextTransform(): TextTransform;
|
|
88
105
|
set TextTransform(v: TextTransform);
|
|
89
106
|
get Padding(): Thickness;
|
|
90
|
-
set Padding(v:
|
|
107
|
+
set Padding(v: ThicknessValue);
|
|
108
|
+
/** A label with text, in Text or in its spans, shows text of its own (no accessibility-label tooltip). */
|
|
109
|
+
ShowsText(): boolean;
|
|
91
110
|
/** Number of laid-out lines after the last measure. */
|
|
92
111
|
get LinesCount(): number;
|
|
93
112
|
AddSubView(control: SkiaControl | TextSpan): void;
|
|
@@ -96,18 +115,54 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
96
115
|
private lines;
|
|
97
116
|
private mainFonts?;
|
|
98
117
|
private readonly fontsCache;
|
|
99
|
-
|
|
118
|
+
/** Runs of a text per style (Segment), and the same runs carrying a span; cleared when the glyph spacing changes. */
|
|
119
|
+
private runCache;
|
|
120
|
+
private spanRunCache;
|
|
121
|
+
/** Wrap tokens of the text, kept while the label has not changed (NeedMeasure) at the same scale. */
|
|
122
|
+
private tokens?;
|
|
123
|
+
/** CharacterSpacing in pixels at the measured scale: added after every glyph of a run (its Width includes them). */
|
|
124
|
+
private glyphSpacing;
|
|
100
125
|
private ResolveFonts;
|
|
101
126
|
/** The label's own style, and the base every span inherits from. */
|
|
102
127
|
private ResolveMainFonts;
|
|
103
128
|
private ResolveSpanFonts;
|
|
104
|
-
private static
|
|
129
|
+
private static NeedsShapingOrRtl;
|
|
130
|
+
/** Width of a text in one font: the shaped glyphs where the text needs shaping (Arabic joins, emoji sequences), else glyph by glyph. */
|
|
131
|
+
private Advance;
|
|
132
|
+
private static readonly Ignorable;
|
|
133
|
+
/**
|
|
134
|
+
* Default-ignorable code points (zero width space, joiners, direction marks, word joiners, variation selectors such
|
|
135
|
+
* as U+FE0F after an emoji, tags) that none of the fonts has draw nothing and take no room, never the missing-glyph
|
|
136
|
+
* box (DrawnUi.Rust label_ignorables; text is not shaped here, C# hides them by shaping).
|
|
137
|
+
*/
|
|
138
|
+
private static DropIgnorables;
|
|
105
139
|
/**
|
|
106
140
|
* Splits text into runs by glyph availability: the main font, or the first fallback that has a glyph where the
|
|
107
|
-
* main font has glyph 0. Spaces always stay on the main font (fallback faces often carry very wide spaces).
|
|
141
|
+
* main font has glyph 0. Spaces always stay on the main font (fallback faces often carry very wide spaces). A joiner,
|
|
142
|
+
* a variation selector, a skin tone or a tag keeps the font of the glyph before it: an emoji sequence is one run.
|
|
108
143
|
*/
|
|
109
144
|
private Segment;
|
|
110
145
|
private Width;
|
|
146
|
+
/** A line never starts with these (closing punctuation, small kana, the long vowel mark): JIS X 4051 kinsoku (C#). */
|
|
147
|
+
private static readonly NoBreakBefore;
|
|
148
|
+
/** A line never ends with these (opening brackets and quotes). */
|
|
149
|
+
private static readonly NoBreakAfter;
|
|
150
|
+
/** Chinese / Japanese: ideographs, kana, CJK punctuation, full-width forms (C# IsCjkAt). Korean breaks at spaces only. */
|
|
151
|
+
private static readonly Cjk;
|
|
152
|
+
private static CanBreakBetween;
|
|
153
|
+
/**
|
|
154
|
+
* C# CanBreakInsideWord: whether a line may break between text[index - 1] and text[index] (UTF-16 indexes) inside a
|
|
155
|
+
* space-free run: next to a Chinese or Japanese character, never before closing punctuation or small kana, never
|
|
156
|
+
* after an opening bracket, never inside a surrogate pair.
|
|
157
|
+
*/
|
|
158
|
+
static CanBreakInsideWord(text: string, index: number): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* C# FitAtBreak: the last place inside the word where a Chinese / Japanese line may break and `prefix` plus the word
|
|
161
|
+
* up to there still fits; code points from the word's start, 0 = none.
|
|
162
|
+
*/
|
|
163
|
+
private FitCjk;
|
|
164
|
+
/** The word cut after `count` code points: the head goes on a line, the rest follows. */
|
|
165
|
+
private SplitWord;
|
|
111
166
|
private Transform;
|
|
112
167
|
/**
|
|
113
168
|
* Paragraphs (split on "\n") of wrap tokens, built from Spans when present, else from Text.
|
|
@@ -116,11 +171,58 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
116
171
|
private Tokenize;
|
|
117
172
|
private NewLine;
|
|
118
173
|
private Append;
|
|
119
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Word-wraps tokens into lines that fit maxWidth (Infinity = no wrap); keeps the lines that fit maxHeight (at least one)
|
|
176
|
+
* and MaxLines, the last kept one ending with a tail ellipsis (C# / DrawnUi.Rust: a label in a box too short for its
|
|
177
|
+
* text cuts it, not only MaxLines).
|
|
178
|
+
*/
|
|
179
|
+
/** The last layout broke a line because the text did not fit: its max-content is wider than the constraint. */
|
|
180
|
+
private wrapped;
|
|
181
|
+
/** The last layout cut lines (MaxLines, height, an ellipsis): its lines depend on the room it had. */
|
|
182
|
+
private truncated;
|
|
183
|
+
/**
|
|
184
|
+
* Lines laid out without wrapping or cutting stay the same for any room that holds them: reused, while nothing in the
|
|
185
|
+
* label changed (NeedMeasure), for a later measure with at least that width and height (C# 5f24f577 label line reuse).
|
|
186
|
+
*/
|
|
187
|
+
private reusable?;
|
|
120
188
|
private LayoutLines;
|
|
189
|
+
/** A paragraph is right to left when its first strong letter is (DrawnUi.Rust split_bidi). */
|
|
190
|
+
static FirstStrongIsRtl(text: string): boolean;
|
|
191
|
+
/** The runs of a line cut where its visual run changes; `map` per UTF-16 index of the line text. */
|
|
192
|
+
private SplitByRuns;
|
|
193
|
+
/**
|
|
194
|
+
* After the layout, lines whose text needs shaping or runs right to left (DrawnUi.Rust build_blobs): with
|
|
195
|
+
* right-to-left text every run is cut where its bidirectional run changes (Unicode bidirectional algorithm, ICU, the
|
|
196
|
+
* paragraph direction from its first strong letter); runs that are right to left or need shaping get shaped glyphs;
|
|
197
|
+
* runs are placed in visual order. Lines without such text are left as they are (plain path).
|
|
198
|
+
*/
|
|
199
|
+
private ShapeLines;
|
|
200
|
+
/**
|
|
201
|
+
* Where each run of a line with right-to-left text goes: visual runs left to right; inside a run, pieces (spans, fonts)
|
|
202
|
+
* in logical order, reversed in a right-to-left run.
|
|
203
|
+
*/
|
|
204
|
+
private static PlaceRuns;
|
|
121
205
|
private LineHeightPx;
|
|
206
|
+
/** ParagraphSpacing above a line that starts a paragraph (after the first): that many of its lines, with their spacing. */
|
|
207
|
+
private ParagraphSpace;
|
|
122
208
|
private BlockHeight;
|
|
123
|
-
|
|
209
|
+
/** Pixels of ink outside the lines' advance boxes, at their left and right ends (side bearings, italic slant). */
|
|
210
|
+
private inkLeft;
|
|
211
|
+
private inkRight;
|
|
212
|
+
/** Ink drawn outside the label's box (a "j" hook, an italic slant) is recorded by caches too, as C# draws it whole. */
|
|
213
|
+
ComputeEffectsMargin(scale: number): Thickness;
|
|
214
|
+
/**
|
|
215
|
+
* C# (after 106e768a): the ink bounds of the first glyph of each line's leftmost run and the last glyph of its
|
|
216
|
+
* rightmost run, beyond the advance box of that run. Two glyph bounds per line, at measure.
|
|
217
|
+
*/
|
|
218
|
+
private MeasureInkOverhang;
|
|
219
|
+
/**
|
|
220
|
+
* Where a line starts inside [left, right] (drawnui-cross 6am): Start and End follow the paragraph's direction (in a
|
|
221
|
+
* right-to-left paragraph Start is the right edge); Center is centered; Fill* lines are not stretched here and sit
|
|
222
|
+
* at the paragraph's start.
|
|
223
|
+
*/
|
|
224
|
+
private LineX;
|
|
225
|
+
protected MeasureAbsolute(widthConstraint: number, heightConstraint: number, scale: number): ScaledSize;
|
|
124
226
|
/** C# GradientByLines: FillGradient spans each line's bounds (default) instead of the whole text block. */
|
|
125
227
|
GradientByLines: boolean;
|
|
126
228
|
/** C# KeepSpacesOnLineBreaks / NeedsGlyphPositions: accepted; glyph boxes are always available through GetGlyphBoxes. */
|
|
@@ -151,8 +253,14 @@ export declare class SkiaLabel extends SkiaControl {
|
|
|
151
253
|
private HasDropShadow;
|
|
152
254
|
/** C# measurement: stroke adds StrokeWidth*2 on each axis, the shadow adds DropShadowSize + offset (pixels). */
|
|
153
255
|
private EffectsExtra;
|
|
154
|
-
/**
|
|
256
|
+
/**
|
|
257
|
+
* FillGradient goes to one place (C# 9637994b, as DrawnUi.Rust): the background of a label that paints one (a
|
|
258
|
+
* BackgroundColor with alpha above 0), whose glyphs keep TextColor; else the glyphs.
|
|
259
|
+
*/
|
|
155
260
|
protected FillGradientPaintsBackground(): boolean;
|
|
261
|
+
private HasBackground;
|
|
262
|
+
/** The gradient the glyphs are painted with: none when the label's background takes FillGradient. */
|
|
263
|
+
protected get TextFillGradient(): SkiaGradient | undefined;
|
|
156
264
|
protected Paint(ctx: DrawingContext): void;
|
|
157
265
|
ProcessGestures(args: SkiaGesturesParameters, apply: GestureEventProcessingInfo): SkiaControl | null;
|
|
158
266
|
/** Pointer cursor over a tappable span (the label itself may not be tappable). */
|