Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIEW and WINDOW do not work together. #545

Open
oitofelix opened this issue Sep 24, 2024 · 1 comment
Open

VIEW and WINDOW do not work together. #545

oitofelix opened this issue Sep 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@oitofelix
Copy link

Describe the bug
Drawing statements don't work properly when both VIEW and WINDOW are active.

To Reproduce
Run the folowing program.

SCREEN 7: _FULLSCREEN

WINDOW (-1, 1)-(1, -1)
WXMin = -.5: WYMin = -.5
WXMax = .5: WYMax = .5
VXMin = PMAP(WXMin, 0): VYMin = PMAP(WYMin, 1)
VXMax = PMAP(WXMax, 0): VYMax = PMAP(WYMax, 1)

PRINT "No WINDOW nor VIEW active."
PRINT "This work as expected."
VIEW SCREEN(VXMin, VYMin)-(VXMax, VYMax), , 4
VIEW
WINDOW
LINE (VXMin, VYMin)-(VXMax, VYMax)
SLEEP

CLS
PRINT "Only WINDOW active."
PRINT "This work as expected."
WINDOW (-1, 1)-(1, -1)
VIEW SCREEN(VXMin, VYMin)-(VXMax, VYMax), , 4
VIEW
LINE (WXMin, WYMin)-(WXMax, WYMax)
SLEEP

CLS 0
PRINT "Only VIEW active."
PRINT "This work as expected."
WINDOW
VIEW SCREEN(VXMin, VYMin)-(VXMax, VYMax), , 4
LINE (VXMin, VYMin)-(VXMax, VYMax)
SLEEP

CLS 0
PRINT "Both WINDOW and VIEW active."
PRINT "Bug!  This does not work as expected."
WINDOW (-1, 1)-(1, -1)
VIEW SCREEN(VXMin, VYMin)-(VXMax, VYMax), , 4
LINE (WXMin, WYMin)-(WXMax, WYMax)

Expected behavior
The drawing behavior must be the same for equivalent drawing statements, regardless of WINDOW and VIEW effects.

Screenshots
image
image
image
image

Desktop (please complete the following information):

  • QB64PE 3.14.1
  • OS: Debian GNU/Linux
@oitofelix oitofelix added the bug Something isn't working label Sep 24, 2024
@oitofelix
Copy link
Author

oitofelix commented Oct 7, 2024

Just want to share that to work around this bug, I use PMAP to get the VIEWport coordinates from the WINDOW coordinates for the drawing at hand, then reset the WINDOW coordinates (as to let only VIEW active), then do the drawing using those physical coordinates obtained in the aforementioned step, and then restore the previous WINDOW coordinates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant