Skip to content

Graphics do not display #4

@conorpeterson

Description

@conorpeterson

System: Macbook with 10.9.3, uname -a:
Darwin magikarp.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64

Java version: Oracle's own Java 8 update 11. java -version:
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

Built with NetBeans 8.0 Patch 2 for Mac, build 201403101706.

Issue: The graphics in the main routing screen do not display. Instead of seeing the board, the program draws only the gray background. Many of the UI buttons do not paint either but do still respond to mouse clicks. Otherwise the program seems to function normally.

Detail: In several drawing routines found in boardgraphics/GraphicsContext.java, the original author attempts to cast a Shape into a Rectangle which leads to an exception on my system. An example from line 130 of GraphicsContext.java:
Rectangle clip_shape = (Rectangle)p_g.getClip() ;

I was able to avoid an exception by changing the line to read:
Rectangle clip_shape = p_g.getClip().getBounds()

The same fix needs to be applied to lines 130, 273, 313, and 432. On my machine, fixing these lines brought the graphics back, everything looks normal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions