mirror of https://github.com/stella-emu/stella.git
Some updates to dialog positioning in preparation for HiDPI.
- note that these are fixes that are needed with or without HiDPI; testing HiDPI just exposed them as bugs - also fixed some minor warnings and formatting
This commit is contained in:
parent
481c85c0c3
commit
dd5a46880e
|
@ -122,8 +122,8 @@ void FBSurfaceSDL2::setVisible(bool visible)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void FBSurfaceSDL2::translateCoords(Int32& x, Int32& y) const
|
void FBSurfaceSDL2::translateCoords(Int32& x, Int32& y) const
|
||||||
{
|
{
|
||||||
x -= myDstR.x;
|
x -= myDstR.x; x /= myDstR.w / mySrcR.w;
|
||||||
y -= myDstR.y;
|
y -= myDstR.y; y /= myDstR.h / mySrcR.h;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -210,9 +210,10 @@ void FBSurfaceSDL2::createSurface(uInt32 width, uInt32 height,
|
||||||
|
|
||||||
// We start out with the src and dst rectangles containing the same
|
// We start out with the src and dst rectangles containing the same
|
||||||
// dimensions, indicating no scaling or re-positioning
|
// dimensions, indicating no scaling or re-positioning
|
||||||
mySrcR.x = mySrcR.y = myDstR.x = myDstR.y = 0;
|
setSrcPos(0, 0);
|
||||||
mySrcR.w = myDstR.w = width;
|
setDstPos(0, 0);
|
||||||
mySrcR.h = myDstR.h = height;
|
setSrcSize(width, height);
|
||||||
|
setDstSize(width, height);
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
// These *must* be set for the parent class
|
// These *must* be set for the parent class
|
||||||
|
|
|
@ -85,9 +85,9 @@ class FBSurface
|
||||||
This method should be called to draw a line.
|
This method should be called to draw a line.
|
||||||
|
|
||||||
@param x The first x coordinate
|
@param x The first x coordinate
|
||||||
@param y The y coordinate
|
@param y The first y coordinate
|
||||||
@param x2 The second x coordinate
|
@param x2 The second x coordinate
|
||||||
@param xy The second y coordinate
|
@param y2 The second y coordinate
|
||||||
@param color The color of the line
|
@param color The color of the line
|
||||||
*/
|
*/
|
||||||
virtual void line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color);
|
virtual void line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color);
|
||||||
|
|
|
@ -116,7 +116,7 @@ void DialogContainer::draw(bool full)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DialogContainer::addDialog(Dialog* d)
|
void DialogContainer::addDialog(Dialog* d)
|
||||||
{
|
{
|
||||||
GUI::Rect r = myOSystem.frameBuffer().imageRect();
|
const GUI::Rect& r = myOSystem.frameBuffer().imageRect();
|
||||||
if(uInt32(d->getWidth()) > r.width() || uInt32(d->getHeight()) > r.height())
|
if(uInt32(d->getWidth()) > r.width() || uInt32(d->getHeight()) > r.height())
|
||||||
myOSystem.frameBuffer().showMessage(
|
myOSystem.frameBuffer().showMessage(
|
||||||
"Unable to show dialog box; resize current window");
|
"Unable to show dialog box; resize current window");
|
||||||
|
|
Loading…
Reference in New Issue