racket / racket/gui

inconsistent line width from draw-line on Windows

Open
#234 0 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 am using Racket 8.2. The width of line with odd y is larger. The backing scale reported by dc is 1.5.

#lang racket
(require racket/gui/base)

(define f (new frame% [label "test"] [width 320] [height 240]))
(define c (new (class canvas%
                 (inherit get-dc)
                 (super-new)

                 (define/override (on-paint)
                   (define dc (get-dc))
                   (send dc draw-line 10 10 100 10)
                   (send dc draw-line 10 21 100 21)))
               [parent f]))

(send f show #t)

image

Setting smoothing mode to 'aligned could alleviate this problem.

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 provided Racket GUI example and the canvas on-paint entry point, then reproduce the two draw-line calls on Windows with a backing scale of 1.5. The issue is done when equivalent horizontal lines have consistent widths without relying on smoothing mode 'aligned.

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.