Mercurial > projects > doodle
view doodle/dia/layer_stack.d @ 89:467febed7367
* Ignore excre
* Some tentative work in grid_layer.d
* Give the ScreenModel to all the layers. This needs refinement.
* A stroke wouldn't hurt occasionally in cairo_renderer.d
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Thu, 19 Aug 2010 00:19:42 +0930 |
parents | 100dd23c7bdf |
children | a98116479793 |
line wrap: on
line source
module doodle.dia.layer_stack; public { import doodle.dia.icanvas; } final class LayerStack { this(in Layer[] layers) { _layers = layers.dup; } Rectangle bounds() const { // Take the union of all layer bounds Rectangle bounds = Rectangle.DEFAULT; foreach (layer; _layers) { bounds = bounds | layer.bounds; } //assert(bounds.valid); return bounds; } void draw(in Rectangle screenDamage, scope Renderer screenRenderer, in Rectangle modelDamage, scope Renderer modelRenderer, in ScreenModel screenModel) const { foreach(layer; _layers) { layer.draw(screenDamage, screenRenderer, modelDamage, modelRenderer, screenModel); } } private { Layer[] _layers; } }