Skip to content

Fix doubled padding on recycled iOS labels - #32

Draft
farfromrefug with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-double-padding-recyclerviews
Draft

Fix doubled padding on recycled iOS labels#32
farfromrefug with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-double-padding-recyclerviews

Conversation

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown

Recycled NLabel instances on iOS could render with accumulated padding because the native draw path applied insets more than once. This change keeps padding sourced from textContainerInset only, so reused cells preserve the expected spacing.

  • Root cause

    • NLabel.drawText(in:) applied:
      • textContainerInset
      • padding
      • borderThickness
    • The iOS TypeScript layer already computes textContainerInset from effective padding and border widths, so the native UILabel path could double-apply the same spacing on reused views.
  • Change

    • Simplified the NLabel draw path to inset only by textContainerInset.
    • Left sizing behavior intact in textRect(forBounds:) and intrinsicContentSize, which still account for padding as before.
  • Effect

    • Prevents padding growth across recycled views such as CollectionView cells.
    • Aligns the UILabel render path with the existing inset computation performed in index.ios.ts.
override func drawText(in rect: CGRect) {
  super.drawText(in: rect.inset(by: self.textContainerInset))
}

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix double padding on RecyclerViews due to ui-label settings Fix doubled padding on recycled iOS labels Sep 2, 2026
Copilot AI requested a review from farfromrefug September 2, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Padding is applied doubled on RecyclerViews (like CollectionView)

2 participants