Skip to content

Commit

Permalink
DIRECTOR: Handle text gutter/border box
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Iskrich authored and sev- committed Aug 3, 2016
1 parent 3cf8510 commit 260c44b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions engines/director/score.cpp
Expand Up @@ -1340,6 +1340,45 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
}

font->drawString(&surface, text, x, y, width, 0);

if (textCast->borderSize != kSizeNone) {
uint16 size = textCast->borderSize;

//Indent from borders, measured in d4
x -= 1;
y -= 4;

height += 4;
width += 1;

while (size) {
surface.frameRect(Common::Rect(x, y, x + height, y + width), 0);
x--;
y--;
height += 2;
width += 2;
size--;
}
}

if (textCast->gutterSize != kSizeNone) {
x -= 1;
y -= 4;

height += 4;
width += 1;
uint16 size = textCast->gutterSize;

surface.frameRect(Common::Rect(x, y, x + height, y + width), 0);

while (size) {
surface.drawLine(x + width, y, x + width, y + height, 0);
surface.drawLine(x, y + height, x + width, y + height, 0);
x++;
y++;
size--;
}
}
}

void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) {
Expand Down

0 comments on commit 260c44b

Please sign in to comment.