private void InvalidateTextRegion(RenderRectangle rect) { if (rect.Width != 0 || rect.Height != 0) { int x1 = 0; int y1 = 0; int x2 = 0; int y2 = 0; // upper y if (rect.Y < this.invalidated.Y) { y1 = rect.Y; } else { y1 = this.invalidated.Y; } // lower y if ((rect.Y + rect.Height) > (this.invalidated.Y + this.invalidated.Height)) { y2 = rect.Y + rect.Height; } else { y2 = this.invalidated.Y + this.invalidated.Height; } // left x if (rect.X < this.invalidated.X) { x1 = rect.X; } else { x1 = this.invalidated.X; } // right x if ((rect.X + rect.Width) > (this.invalidated.X + this.invalidated.Width)) { x2 = rect.X + rect.Width; } else { x2 = this.invalidated.X + this.invalidated.Width; } this.invalidated.X = x1; this.invalidated.Y = y1; this.invalidated.Width = x2 - x2; this.invalidated.Height = y2 - y1; } else { this.invalidated.X = rect.X; this.invalidated.Y = rect.Y; this.invalidated.Width = rect.Width; this.invalidated.Height = rect.Height; } }
public void UpdateTextRegion() { this.Interpreter.GraphicsDriver.Update(this.invalidated); this.invalidated = default(RenderRectangle); }