Skip to content

plot/scroll fixes#99

Merged
breakintoprogram merged 1 commit intobreakintoprogram:mainfrom
stevesims:fix-plot-upstream
Sep 27, 2023
Merged

plot/scroll fixes#99
breakintoprogram merged 1 commit intobreakintoprogram:mainfrom
stevesims:fix-plot-upstream

Conversation

@stevesims
Copy link
Copy Markdown
Contributor

fixes issue with “scroll” caused by fill colour being set when it wasn’t needed to be

fixes circle for rectangular pixel modes (they were being drawn double-height)

Comment thread video/graphics.h
case 1: {
// use fg colour
canvas->setPenColor(gfg);
canvas->setBrushColor(gfg);
Copy link
Copy Markdown
Contributor Author

@stevesims stevesims Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these setBrushColor calls are unnecessary - they're a "fill colour" thing for filled shapes, but for filled shapes we call the setGraphicsFill function (that's just below this one)

when these calls are here, a canvas->scroll call will end up filling columns - removing them makes the scrolling stars demo work properly (well, once that demo has been fixed with a corrected PLOT call and appropriate MODE to work properly with latest VDP 😁)

Comment thread video/graphics.h
auto size = 2 * sqrt(rp1.X * rp1.X + rp1.Y * rp1.Y);
if (filled) {
canvas->fillEllipse(p2.X, p2.Y, size, size);
canvas->fillEllipse(p2.X, p2.Y, size, rectangularPixels ? size / 2 : size);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd noticed that the random circles demo (circles_2.bas) would draw elongated circles when in 640x240 resolution screen modes. thinking this thru, it's because fab-gl doesn't draw circles, it draws squished circles (ellipses). this code wasn't caring about pixel shape, and was assuming all pixels are square

our rectangular pixel modes are all 2x1, so this fixes their shape

fixes issue with “scroll” caused by fill colour being set when it wasn’t needed to be

fixes circle for rectangular pixel modes
@breakintoprogram breakintoprogram added the enhancement New feature or request label Sep 27, 2023
@breakintoprogram breakintoprogram merged commit 8ca0037 into breakintoprogram:main Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

2 participants