Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23548/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Adjusted size of grid
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** View.java 17 Jul 2006 09:08:42 -0000 1.107
--- View.java 17 Jul 2006 13:56:28 -0000 1.108
***************
*** 155,159 ****
/** The size of the viewing area */
! protected static double gridSize = 25.0;
/** The last touched surface */
--- 155,162 ----
/** The size of the viewing area */
! protected static double gridSize = 70.0;
!
! /** Adjust the size of the grid based on aspect ? */
! protected static boolean adjustGridSize = true;
/** The last touched surface */
***************
*** 330,333 ****
--- 333,353 ----
/**
+ * Calculate the grid size
+ * @return The grid size
+ */
+ public static double gridSize() {
+ double size = gridSize;
+ if (adjustGridSize) {
+ if (aspect > 1) {
+ size *= aspect;
+ } else {
+ size /= aspect;
+ }
+ size /= 2;
+ }
+ return size;
+ }
+
+ /**
* Set the highlight pattern
*/
***************
*** 639,652 ****
*/
protected void grid() {
! double size = View.gridSize;
! if (aspect > 1) {
! size *= aspect;
! } else {
! size /= aspect;
! }
gl.glColor4fv(gridColor);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glBegin(GL.GL_LINES);
! size /= 2;
for (int x = -(int)size; x <= (int)size; x++) {
--- 659,675 ----
*/
protected void grid() {
! double size = View.gridSize();
!
! Project.info("size = " + size);
!
!
! Project.info("adjusted size = " + size);
!
gl.glColor4fv(gridColor);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glBegin(GL.GL_LINES);
!
!
!
for (int x = -(int)size; x <= (int)size; x++) {
***************
*** 665,682 ****
*/
protected void coords() {
! double size = View.gridSize;
! if (aspect > 1) {
! size *= aspect;
! } else {
! size /= aspect;
! }
gl.glBegin(GL.GL_LINES);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glColor3fv(X_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(size, 0.0, 0.0);
gl.glColor3fv(Y_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(0.0, size, 0.0);
gl.glEnd();
gl.glEnable(GL.GL_DEPTH_TEST);
--- 688,701 ----
*/
protected void coords() {
! double size = View.gridSize();
!
gl.glBegin(GL.GL_LINES);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glColor3fv(X_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(size * 2, 0.0, 0.0);
gl.glColor3fv(Y_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(0.0, size * 2, 0.0);
gl.glEnd();
gl.glEnable(GL.GL_DEPTH_TEST);
***************
*** 684,688 ****
gl.glColor3fv(Z_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(0.0, 0.0, size);
gl.glEnd();
}
--- 703,707 ----
gl.glColor3fv(Z_AXIS_COLOR);
gl.glVertex3d(0.0, 0.0, 0.0);
! gl.glVertex3d(0.0, 0.0, size * 2);
gl.glEnd();
}
|