diff --git a/README.md b/README.md index 50d429a..8923908 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,9 @@ the `V` key. Rows and columns are now stored as sorted lists intead of sets. Rows and columns are now in a consistent order in the file export. Performance boosts in bit marking, background bit marking and alignment. Universal binary for macOS. RomAlignerTilting works -better for designs with a gap between banks. +better for designs with a gap between banks. Out-of-view bits are no +longer drawn during dragging, speeding up adjusting groups of long +lines. 2024-07-14 -- Fixes crash when deleting a double-selected item. Delete and backspace now delete objects like `D`. Multiple disassemblers. diff --git a/maskromtool.cpp b/maskromtool.cpp index 73988d8..8700036 100644 --- a/maskromtool.cpp +++ b/maskromtool.cpp @@ -1401,6 +1401,11 @@ void MaskRomTool::markBit(RomLineItem* row, RomLineItem* col){ //This rectangle will be a small box around the pixel. QPointF point=bitLocation(row, col); + //When dragging, skip anything that's not immediately visible. + if(dragging && !isPointVisible(point)) + return; + + RomBitItem *bit=new RomBitItem(point, bitSize, row, col); scene->addItem(bit); bit->setVisible(bitsVisible); @@ -1534,6 +1539,24 @@ static bool colthroughrect(QLineF line, QRectF rect){ return false; } +//Is a point visible? Handy when dragging. +bool MaskRomTool::isPointVisible(QPointF p){ + //Primary view. + QRectF rect=view->mapToScene(view->viewport()->rect()).boundingRect(); + if(p.x()rect.left() + && p.y()>rect.top() && p.y()mapToScene(second.view->viewport()->rect()).boundingRect(); + if(p.x()rect.left() + && p.y()>rect.top() && p.y() list, QPointF offset); //Inserts a new line, either row or column. bool insertLine(RomLineItem* line); + //Is a point visible? Handy when dragging. + bool isPointVisible(QPointF p); //Get a bit at a point. RomBitItem* getBit(QPointF point); diff --git a/romscene.cpp b/romscene.cpp index 917a204..87c58cc 100644 --- a/romscene.cpp +++ b/romscene.cpp @@ -192,6 +192,7 @@ void RomScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent){ //Right mouse can drag a line, so we mark an undo point before moving. if(mouseEvent->buttons()==Qt::RightButton){ + maskRomTool->dragging=true; maskRomTool->markUndoPoint(); maskRomTool->clearBits(false); } @@ -222,7 +223,6 @@ void RomScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent){ //qDebug()<<"Selection: "<dragging=false; if(maskRomTool->bitsVisible){ //Clear the old bits in the background. //This will continue until redrawing them.