racket / racket/gui

Maximum canvas% scroll-range of 1,000,000 pixels?

Open
#295 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

I see the following contract violation in my program when the scroll range exceeds 1,000,000. I'm providing pixels as the units to the set-scroll-range function. Assuming using pixels is correct here, I propose 1,000,000 pixels is too small for a maximum range since I have run into the limit displaying a text file with about 30,000 lines.

set-scroll-range in canvas%: contract violation
expected: (integer-in 0 1000000)
given: 1130504.0
Context (plain; to see better errortrace context, re-run with C-u prefix):
/usr/local/racket/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
/usr/local/racket/collects/ffi/unsafe/atomic.rkt:73:13
/home/jonathan/git/molasses/src/test/newcanvas.rkt:265:4 update-scrollbars
/usr/local/racket/collects/racket/private/more-scheme.rkt:148:2 call-with-break-parameterization
/usr/local/racket/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
/usr/local/racket/collects/ffi/unsafe/atomic.rkt:73:13
/usr/local/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:435:6
/usr/local/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:460:2 yield

Contributor guide

Open the contributing guide

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

Start with the canvas% set-scroll-range entry point and reproduce the reported value from src/test/newcanvas.rkt in update-scrollbars. Check how the 1,000,000 contract limit relates to pixel units and scrollbar behavior. Done means the supported range is clarified and the reported over-limit case has an appropriate, tested outcome.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.