comparison doodle/gtk/cairo_canvas.d @ 100:a274d16ab6ce

struct initialisers
author David Bryant <bagnose@gmail.com>
date Mon, 18 Oct 2010 18:10:02 +1030
parents a98116479793
children 345fb56d89fc
comparison
equal deleted inserted replaced
99:ad672ab258c5 100:a274d16ab6ce
36 } 36 }
37 37
38 final class CairoCanvas : Table, private IViewport { 38 final class CairoCanvas : Table, private IViewport {
39 this(in Layer[] layers, IEventHandler eventHandler, IGrid grid, in double pixelsPerMillimetre) { 39 this(in Layer[] layers, IEventHandler eventHandler, IGrid grid, in double pixelsPerMillimetre) {
40 super(3, 3, 0); 40 super(3, 3, 0);
41
42 _damageScreen = Rectangle.DEFAULT;
43 41
44 _eventHandler = eventHandler; 42 _eventHandler = eventHandler;
45 _grid = grid; 43 _grid = grid;
46 _pixelsPerMillimetre = pixelsPerMillimetre; 44 _pixelsPerMillimetre = pixelsPerMillimetre;
47 45
408 void fixDamage() { 406 void fixDamage() {
409 if (_damageScreen.valid) { 407 if (_damageScreen.valid) {
410 int x, y, w, h; 408 int x, y, w, h;
411 _damageScreen.getQuantised(x, y, w, h); 409 _damageScreen.getQuantised(x, y, w, h);
412 _drawingArea.queueDrawArea(x, cast(int)_screenModel.viewBoundsScreen.h - (y + h), w, h); 410 _drawingArea.queueDrawArea(x, cast(int)_screenModel.viewBoundsScreen.h - (y + h), w, h);
413 _damageScreen = Rectangle.DEFAULT; 411 _damageScreen = Rectangle();
414 } 412 }
415 } 413 }
416 414
417 void onRealize(Widget widget) { 415 void onRealize(Widget widget) {
418 assert(widget is _drawingArea); 416 assert(widget is _drawingArea);