Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,8 @@ class SkParagraphBuilder {
external void pushPaintStyle(
SkTextStyle textStyle, SkPaint foreground, SkPaint background);
external void pop();
external void addPlaceholder(SkPlaceholderStyleProperties placeholderStyle);
external void addPlaceholder(double? width, double? height,
SkPlaceholderAlignment? alignment, SkTextBaseline? baseline, double? offset);
external SkParagraph build();
external void delete();
}
Expand Down Expand Up @@ -1624,6 +1625,12 @@ class SkStrutStyleProperties {
@JS()
@anonymous
class SkPlaceholderStyleProperties {
external double? get width;
external double? get height;
external SkPlaceholderAlignment? get alignment;
external double? get offset;
external SkTextBaseline? get baseline;

external set width(double? value);
external set height(double? value);
external set alignment(SkPlaceholderAlignment? value);
Expand Down
8 changes: 7 additions & 1 deletion lib/web_ui/lib/src/engine/canvaskit/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,13 @@ class CkParagraphBuilder implements ui.ParagraphBuilder {

void _addPlaceholder(SkPlaceholderStyleProperties placeholderStyle) {
_commands.add(_ParagraphCommand.addPlaceholder(placeholderStyle));
_paragraphBuilder.addPlaceholder(placeholderStyle);
_paragraphBuilder.addPlaceholder(
placeholderStyle.width,
placeholderStyle.height,
placeholderStyle.alignment,
placeholderStyle.baseline,
placeholderStyle.offset,
);
}

static SkPlaceholderStyleProperties toSkPlaceholderStyle(
Expand Down