X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Ftoolwindow.cpp;h=0bee1face47b438a5ca7de8e75e8cd39987b7dda;hb=cf3ec188764cdf34ff3472ee9806aba3a772d2df;hp=75eaa0e1a3c129aec0d176ac9f7979e0cfb1c956;hpb=0cdf0ebfb4b788156b8eb2c2acadd5f95fe5be26;p=ttedit diff --git a/src/toolwindow.cpp b/src/toolwindow.cpp index 75eaa0e..0bee1fa 100755 --- a/src/toolwindow.cpp +++ b/src/toolwindow.cpp @@ -34,7 +34,7 @@ ToolWindow::ToolWindow(void): QWidget(NULL, Qt::Window | Qt::FramelessWindowHint // Set up sizes sizeTPBM.rx() = img.width(), sizeTPBM.ry() = img.height(); - sizeStamp.rx() = sizeTPBM.x() / 4, sizeStamp.ry() = sizeTPBM.y() / 2; + sizeStamp.rx() = sizeTPBM.x() / 5, sizeStamp.ry() = sizeTPBM.y() / 2; setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setVisible(false); @@ -54,7 +54,8 @@ 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 & 0x03), sizeStamp.y() * (prevTool >> 2)); + QPoint pt(sizeStamp.x() * (prevTool % 5), sizeStamp.y() * (prevTool / 5)); p.drawImage(pt.x(), pt.y(), img, pt.x(), pt.y(), sizeStamp.x(), sizeStamp.y()); } } @@ -76,8 +77,12 @@ ToolType ToolWindow::FindSelectedTool(void) ToolType newTool = TOOLNone; // NOTE: This works because x and y are UNSIGNED - if (x < 4 && y < 2) - newTool = (ToolType)((y * 4) + x); + if (x < 5 && y < 2) + newTool = (ToolType)((y * 5) + x); + + // We don't have 10 yet, so fix this if the user selected the blank space + if (newTool == 9) + newTool = TOOLNone; return newTool; }