LivelyKernel / LivelyKernel/LivelyKernel

empty TextMorph grows uncontrollably under some conditions

Open
#335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
304
Forks
60
PR merge metrics
No merged PRs in 30d

Description

Issue world: http://lively-web.org/issues/IssueTemplate.html

reported by AranLunzer:

The TextMorph growOrShrinkToFit() method, recently changed, now defines its desired size by adding padding to the size obtained from getTextExtent(). But if the morph is empty (and non-editable, therefore having no cursor) getTextExtent() returns the same value as getExtent(). The outcome is that on every call to growOrShrinkToFit(), the morph grows by its padding size.

See world http://lively-web.org/users/AranLunzer/text-resize-bug.html

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the TextMorph growOrShrinkToFit() method and inspect how it combines getTextExtent(), getExtent(), and padding for an empty, non-editable morph. Reproduce the behavior with the linked text-resize-bug world, then verify that repeated calls no longer increase the morph’s size.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.