Unable to call get-text-extent on bitmap-dc
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
The documentation states that I should be able to call get-text-extent on a bitmap-dc without specifying a bitmap, but I get an error "drawing context is not ok".
#lang racket
;; Racket v6.10.1
(require racket/gui)
(define dummy-dc (new bitmap-dc%))
;; with a bitmap set it works
;; (define dummy-dc (new bitmap-dc% [bitmap (make-bitmap 1 1)]))
(define-values (width height delta-baseline vertical-space)
(send dummy-dc get-text-extent "test text"))
(displayln width)
without a bitmap set I get:
get-text-extent in dc<%>: drawing context is not ok: (wrapper-object:bitmap-dc% ...)
context...:
/usr/share/racket/pkgs/draw-lib/racket/draw/private/dc.rkt:1341:4: core1416
...t/private/kw.rkt:763:9
although the documentation states:
A bitmap% object must be supplied at initialization or installed into a bitmap
DC using set-bitmap before any other method of the DC is called, except
get-text-extent, get-char-height, or get-char-width.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the provided Racket example, then inspect racket/draw/private/dc.rkt around the reported line and the bitmap-dc% documentation for the exception behavior. Confirm whether the documented get-text-extent exception is supported; done means the implementation and documentation agree and the example behaves accordingly.
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
- Clearly specified
- Newbie friendliness
- 45/100