From 7570278999fa2cd352689b0f7bcd26bc468c582f Mon Sep 17 00:00:00 2001 From: "giantpune@gmail.com" Date: Wed, 29 Dec 2010 04:12:20 +0000 Subject: [PATCH] * made a bug git-svn-id: http://wiiqt.googlecode.com/svn/trunk@33 389f4c8b-5dfe-645f-db0e-df882bc27289 --- breft_editor/mainwindow.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/breft_editor/mainwindow.cpp b/breft_editor/mainwindow.cpp index 32ee692..ce3964e 100644 --- a/breft_editor/mainwindow.cpp +++ b/breft_editor/mainwindow.cpp @@ -151,21 +151,21 @@ void MainWindow::on_actionLoad_triggered() // SHOW TPL ON SCREEN //if you have a format that uses palette data, you need to add that to the last arg here QImage img = ConvertTextureToImage( pic_data, pic_head.width, pic_head.height, pic_head.format ); - if( img.isNull() )//error converting - continue; - - QGraphicsPixmapItem *item = new QGraphicsPixmapItem( QPixmap::fromImage( img ) ); - if( x + img.width() + spacing >= (quint32)gv->width() )//this row is filled up, skip down and start a new row + if( !img.isNull() )//error converting { - x = spacing; - y += spacing + rowHeight; - rowHeight = 0; + QGraphicsPixmapItem *item = new QGraphicsPixmapItem( QPixmap::fromImage( img ) ); + if( x + img.width() + spacing >= (quint32)gv->width() )//this row is filled up, skip down and start a new row + { + x = spacing; + y += spacing + rowHeight; + rowHeight = 0; + } + rowHeight = MAX( rowHeight, ((quint32)img.height()) ); + //qDebug() << "setting image" << ii << "at" << x << y; + item->setPos( x, y ); + gs.addItem( item ); + x += img.width() + spacing; } - rowHeight = MAX( rowHeight, ((quint32)img.height()) ); - //qDebug() << "setting image" << ii << "at" << x << y; - item->setPos( x, y ); - gs.addItem( item ); - x += img.width() + spacing; // SAVE TPL TO FILE #if 0