Skip to content

Commit daae02d

Browse files
Streamlining clearBits. #121
1 parent 04c88d9 commit daae02d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

maskromtool.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ bool MaskRomTool::markBits(bool full){
16291629

16301630

16311631
//Maximum number of bits that we might clear in one frame.
1632-
#define BITCLEARINGLIMIT 5000
1632+
#define BITCLEARINGLIMIT 25000
16331633

16341634
//Mark up all of the bits where rows and columns collide.
16351635
void MaskRomTool::clearBits(bool full){
@@ -1645,22 +1645,13 @@ void MaskRomTool::clearBits(bool full){
16451645
* wipe away bits without hogging the redraw thread. Like markBits(),
16461646
* it might take a few frames to finish on large projects.
16471647
*/
1648-
1649-
//Grab all those that are visible first.
1650-
auto rect=view->mapToScene(view->viewport()->rect()).boundingRect();
1651-
auto secondrect=second.view->mapToScene(second.view->viewport()->rect()).boundingRect();
1652-
1653-
if(!second.isVisible()) secondrect=rect;
1654-
foreach(QGraphicsItem* item,
1655-
//view->items(view->sceneRect().toRect())){
1656-
bits){
1657-
if( (rect.contains(item->pos()) || secondrect.contains(item->pos()))
1658-
&& count++<BITCLEARINGLIMIT
1659-
){
1648+
foreach(QGraphicsItem* item, bits){
1649+
if(isPointVisible(item->pos())){
16601650
scene->removeItem(item);
16611651
delete item;
16621652
bits.removeOne(item);
16631653
bitcount--;
1654+
count++;
16641655
}
16651656
}
16661657
//Grab some more opportunistically.

0 commit comments

Comments
 (0)