mirror of https://github.com/stella-emu/stella.git
HiDPI fixes for framebuffer messages.
This commit is contained in:
parent
e572bea642
commit
cbb494d7ad
|
@ -418,6 +418,8 @@ void FrameBuffer::enableMessages(bool enable)
|
||||||
inline void FrameBuffer::drawMessage()
|
inline void FrameBuffer::drawMessage()
|
||||||
{
|
{
|
||||||
// Draw the bounded box and text
|
// Draw the bounded box and text
|
||||||
|
const GUI::Rect& dst = myMsg.surface->dstRect();
|
||||||
|
|
||||||
switch(myMsg.position)
|
switch(myMsg.position)
|
||||||
{
|
{
|
||||||
case MessagePosition::TopLeft:
|
case MessagePosition::TopLeft:
|
||||||
|
@ -426,43 +428,43 @@ inline void FrameBuffer::drawMessage()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::TopCenter:
|
case MessagePosition::TopCenter:
|
||||||
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
myMsg.x = (myImageRect.width() - dst.width()) >> 1;
|
||||||
myMsg.y = 5;
|
myMsg.y = 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::TopRight:
|
case MessagePosition::TopRight:
|
||||||
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
myMsg.x = myImageRect.width() - dst.width() - 5;
|
||||||
myMsg.y = 5;
|
myMsg.y = 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::MiddleLeft:
|
case MessagePosition::MiddleLeft:
|
||||||
myMsg.x = 5;
|
myMsg.x = 5;
|
||||||
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
myMsg.y = (myImageRect.height() - dst.height()) >> 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::MiddleCenter:
|
case MessagePosition::MiddleCenter:
|
||||||
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
myMsg.x = (myImageRect.width() - dst.width()) >> 1;
|
||||||
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
myMsg.y = (myImageRect.height() - dst.height()) >> 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::MiddleRight:
|
case MessagePosition::MiddleRight:
|
||||||
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
myMsg.x = myImageRect.width() - dst.width() - 5;
|
||||||
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
myMsg.y = (myImageRect.height() - dst.height()) >> 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::BottomLeft:
|
case MessagePosition::BottomLeft:
|
||||||
myMsg.x = 5;
|
myMsg.x = 5;
|
||||||
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
myMsg.y = myImageRect.height() - dst.height() - 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::BottomCenter:
|
case MessagePosition::BottomCenter:
|
||||||
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
myMsg.x = (myImageRect.width() - dst.width()) >> 1;
|
||||||
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
myMsg.y = myImageRect.height() - dst.height() - 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MessagePosition::BottomRight:
|
case MessagePosition::BottomRight:
|
||||||
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
myMsg.x = myImageRect.width() - dst.width() - 5;
|
||||||
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
myMsg.y = myImageRect.height() - dst.height() - 5;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue