X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftoolwindow.cpp;h=5fd774c1498430542df30b7ec84403e2afaf2041;hb=2b16243b0aa693d18ce49a071cdae73cadc37c4f;hp=0bee1face47b438a5ca7de8e75e8cd39987b7dda;hpb=cf3ec188764cdf34ff3472ee9806aba3a772d2df;p=ttedit diff --git a/src/toolwindow.cpp b/src/toolwindow.cpp index 0bee1fa..5fd774c 100755 --- a/src/toolwindow.cpp +++ b/src/toolwindow.cpp @@ -29,12 +29,13 @@ ToolWindow::ToolWindow(void): QWidget(NULL, Qt::Window | Qt::FramelessWindowHint), prevTool(TOOLNone) { - img = QImage(":/res/toolpal1.xpm"); +// img = QImage(":/res/toolpal1.xpm"); + img = QImage(":/res/toolpal1.png"); // Set up sizes sizeTPBM.rx() = img.width(), sizeTPBM.ry() = img.height(); - sizeStamp.rx() = sizeTPBM.x() / 5, sizeStamp.ry() = sizeTPBM.y() / 2; + sizeStamp.rx() = sizeTPBM.x() / 4, sizeStamp.ry() = sizeTPBM.y() / 3; setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setVisible(false); @@ -55,7 +56,7 @@ void ToolWindow::paintEvent(QPaintEvent * event) //need ul corner of bitmap, ul corner of dest, width/height p.setCompositionMode(QPainter::RasterOp_NotSource); // QPoint pt(sizeStamp.x() * (prevTool & 0x03), sizeStamp.y() * (prevTool >> 2)); - QPoint pt(sizeStamp.x() * (prevTool % 5), sizeStamp.y() * (prevTool / 5)); + QPoint pt(sizeStamp.x() * (prevTool % 4), sizeStamp.y() * (prevTool / 4)); p.drawImage(pt.x(), pt.y(), img, pt.x(), pt.y(), sizeStamp.x(), sizeStamp.y()); } } @@ -77,11 +78,11 @@ ToolType ToolWindow::FindSelectedTool(void) ToolType newTool = TOOLNone; // NOTE: This works because x and y are UNSIGNED - if (x < 5 && y < 2) - newTool = (ToolType)((y * 5) + x); + if (x < 4 && y < 3) + newTool = (ToolType)((y * 4) + x); - // We don't have 10 yet, so fix this if the user selected the blank space - if (newTool == 9) + // We don't have 11 yet, so fix this if the user selected the blank space + if (newTool > 10) newTool = TOOLNone; return newTool;