Skip to content

Improve drawing of lines#108

Open
moreginger wants to merge 1 commit into
TinyCircuits:mainfrom
moreginger:patch-1
Open

Improve drawing of lines#108
moreginger wants to merge 1 commit into
TinyCircuits:mainfrom
moreginger:patch-1

Conversation

@moreginger

Copy link
Copy Markdown

Note: I'm not very familiar with C, so this might be garbage, but hopefully the intent is clear?

  • Draw a pixel at the start of the line

Should this be controlled by a flag? There could be an issue when using opacity, but it seems more intuitive to render the line from the start to the end. I think this is what the linked algorithm does too, i.e. <= step

  while (i <= step) {
    putpixel(round(x), round(y), 5);
  • Avoid gaps rendering fractional coordinates

I found that when rendering some fractional points the line was not contiguous, e.g.

engine_draw.line(engine_draw.white, 73.5, 65.9, 71.2, 71.2, 1.0)

simulator_screenshot (3)

I think something like this change would fix it.

- Draw a pixel at the start of the line
- Avoid gaps rendering fractional coordinates
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.

1 participant