Qt: Fix centering of sprite preview
Jeffrey Pfau jeffrey@endrift.com
Fri, 21 Oct 2016 02:15:12 -0700
2 files changed,
2 insertions(+),
6 deletions(-)
M
src/platform/qt/ObjView.cpp
→
src/platform/qt/ObjView.cpp
@@ -59,11 +59,12 @@ unsigned size = GBAObjAttributesBGetSize(obj->b);
unsigned width = GBAVideoObjSizes[shape * 4 + size][0]; unsigned height = GBAVideoObjSizes[shape * 4 + size][1]; m_ui.tiles->setTileCount(width * height / 64); - m_ui.tiles->resize(QSize(width, height) * m_ui.magnification->value()); + m_ui.tiles->setMinimumSize(QSize(width, height) * m_ui.magnification->value()); unsigned palette = GBAObjAttributesCGetPalette(obj->c); unsigned tile = GBAObjAttributesCGetTile(obj->c); int i = 0; // TODO: Tile stride + // TODO: Check to see if parameters are changed (so as to enable force if needed) if (GBAObjAttributesAIs256Color(obj->a)) { mTileCacheSetPalette(m_tileCache.get(), 1); m_ui.tile->setPalette(0);
M
src/platform/qt/TilePainter.cpp
→
src/platform/qt/TilePainter.cpp
@@ -28,11 +28,6 @@ }
void TilePainter::resizeEvent(QResizeEvent* event) { int w = width() / m_size; - if (w < 1) { - // FIXME: Uhh...how did we get here? - // Resizing the window when magnification > 1 seems to trigger this - return; - } int calculatedHeight = (m_tileCount + w - 1) * m_size / w; calculatedHeight -= calculatedHeight % m_size; if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) {