Fix layout rendering, text wrapping, and scrollbar issues
- LinuxViewRenderer: Remove redundant child rendering that caused "View already has a parent" errors - SkiaLabel: Consider LineBreakMode.WordWrap for multi-line measurement and rendering - SkiaScrollView: Update ContentSize in OnDraw with properly constrained measurement - SkiaShell: Account for padding in MeasureOverride (consistent with ArrangeOverride) - Version bump to 1.0.0-preview.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -429,9 +429,10 @@ public class SkiaLabel : SkiaView
|
||||
bounds.Bottom - Padding.Bottom);
|
||||
|
||||
// Handle single line vs multiline
|
||||
// Use DrawSingleLine for normal labels (MaxLines <= 1 or unlimited) without newlines
|
||||
// Use DrawMultiLineWithWrapping only when MaxLines > 1 (word wrap needed) or text has newlines
|
||||
bool needsMultiLine = MaxLines > 1 || Text.Contains('\n');
|
||||
// Use DrawMultiLineWithWrapping when: MaxLines > 1, text has newlines, OR WordWrap is enabled
|
||||
bool needsMultiLine = MaxLines > 1 || Text.Contains('\n') ||
|
||||
LineBreakMode == LineBreakMode.WordWrap ||
|
||||
LineBreakMode == LineBreakMode.CharacterWrap;
|
||||
if (needsMultiLine)
|
||||
{
|
||||
DrawMultiLineWithWrapping(canvas, paint, font, contentBounds);
|
||||
@@ -771,8 +772,10 @@ public class SkiaLabel : SkiaView
|
||||
using var font = new SKFont(typeface, FontSize);
|
||||
using var paint = new SKPaint(font);
|
||||
|
||||
// Use same logic as OnDraw: multiline only when MaxLines > 1 or text has newlines
|
||||
bool needsMultiLine = MaxLines > 1 || Text.Contains('\n');
|
||||
// Use multiline when: MaxLines > 1, text has newlines, OR WordWrap is enabled
|
||||
bool needsMultiLine = MaxLines > 1 || Text.Contains('\n') ||
|
||||
LineBreakMode == LineBreakMode.WordWrap ||
|
||||
LineBreakMode == LineBreakMode.CharacterWrap;
|
||||
if (!needsMultiLine)
|
||||
{
|
||||
var textBounds = new SKRect();
|
||||
|
||||
Reference in New Issue
Block a user