comparison doodle/gtk/canvas.d @ 58:c63719604adb

Beginnings of creating a rectangle...
author "David Bryant <bagnose@gmail.com>"
date Mon, 09 Aug 2010 21:43:24 +0930
parents 9960c4fbd0dd
children 6c3993f4c3eb
comparison
equal deleted inserted replaced
57:9960c4fbd0dd 58:c63719604adb
451 451
452 queueDraw; 452 queueDraw;
453 } 453 }
454 454
455 void updateRulers() { 455 void updateRulers() {
456 invariant Vector modelSize = pixelToModel(_viewSize); 456 immutable Vector modelSize = pixelToModel(_viewSize);
457 457
458 invariant Point viewLeftBottom = _viewCentre - modelSize / 2.0; 458 immutable Point viewLeftBottom = _viewCentre - modelSize / 2.0;
459 invariant Point viewRightTop = _viewCentre + modelSize / 2.0; 459 immutable Point viewRightTop = _viewCentre + modelSize / 2.0;
460 460
461 // Define these just to obtain the position 461 // Define these just to obtain the position
462 // below and we can preserve it 462 // below and we can preserve it
463 double lower, upper, position, maxSize; 463 double lower, upper, position, maxSize;
464 464
474 position, 474 position,
475 _zoom * 50.0); 475 _zoom * 50.0);
476 } 476 }
477 477
478 void updateAdjustments() { 478 void updateAdjustments() {
479 invariant Vector modelSize = pixelToModel(_viewSize); 479 immutable Vector modelSize = pixelToModel(_viewSize);
480 480
481 invariant Point viewLeftBottom = _viewCentre - modelSize / 2.0; 481 immutable Point viewLeftBottom = _viewCentre - modelSize / 2.0;
482 invariant Point viewRightTop = _viewCentre + modelSize / 2.0; 482 immutable Point viewRightTop = _viewCentre + modelSize / 2.0;
483 483
484 // Adjust the canvas size if necessary 484 // Adjust the canvas size if necessary
485 _canvasBounds = Rectangle(minExtents(_canvasBounds.minCorner, viewLeftBottom), 485 _canvasBounds = Rectangle(minExtents(_canvasBounds.minCorner, viewLeftBottom),
486 maxExtents(_canvasBounds.maxCorner, viewRightTop)); 486 maxExtents(_canvasBounds.maxCorner, viewRightTop));
487 487