aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/macgui/mactext.cpp11
-rw-r--r--graphics/macgui/mactext.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 4807e19dbb..fde79f910e 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -94,4 +94,15 @@ void MacText::render() {
}
}
+void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
+ render();
+
+ if (x + w < _surface.w || y + h < _surface.h) {
+ g->fillRect(Common::Rect(x, y, x + w, y + w), _bgcolor);
+ }
+
+ g->blitFrom(_surface, Common::Rect(MIN<int>(_surface.w, x), MIN<int>(_surface.h, y),
+ MIN<int>(_surface.w, x + w), MIN<int>(_surface.w, y + w)), Common::Point(xoff, yoff));
+}
+
} // End of namespace Graphics
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 7831e65c46..4add3948fa 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -34,6 +34,9 @@ public:
void setInterLinear(int interLinear) { _interLinear = interLinear; }
+ void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
+
+
private:
void splitString();
void render();