- void draw() {
- if(needsInvalidation) {
- drawContentToTexture(); //abstrakte methode
- needsInvalidation = false;
- }
- drawTexture();
- }
- void setNeedsInvalidation() {
- needsInvalidation = true;
- if(parent != null) {
- parent.setNeedsInvalidation();
- } else {
- context.redraw();
- }
- }