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

canvas.getHeight() doesn't correctly returns the canvas height #27

Open
AviannaBui opened this issue Nov 14, 2022 · 1 comment
Open

Comments

@AviannaBui
Copy link

Description

The method getHeight() for CanvasWindow object on my computer does not return the correct height

Steps to Reproduce (also see the attached picture for reference)

import edu.macalester.graphics.*;

public class BreakoutGame {
    
        private static final int CANVAS_WIDTH = 600;
        private static final int CANVAS_HEIGHT = 800;
        private CanvasWindow canvas;

        public BreakoutGame() {
            canvas = new CanvasWindow("Breakout!", CANVAS_WIDTH, CANVAS_HEIGHT);
    }
   
    public void run() {
            System.out.println(canvas.getHeight());
    }
    
    public static void main(String[] args) {
            new BreakoutGame().run();
    }
    
}

Expected behavior

The number 800 is printed out

Actual behavior

The number 700 is printed out
bugggg

@AviannaBui
Copy link
Author

A similar(?) problem happens with my canvas.getWidth() (the printed width for the small-scale window is 600, but when I enlarge the window to its full size, the printed width changes to 1281

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

No branches or pull requests

1 participant