浏览代码

tools.cpp edited online with Bitbucket

父节点
当前提交
8ab8829054
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5
    2
      tools.cpp

+ 5
- 2
tools.cpp 查看文件

@@ -18,8 +18,11 @@ void GridWidget::Dot(int x, int y, QColor toolColor){
18 18
 // it hits a cell of a different color than that one clicked.
19 19
 
20 20
 void GridWidget::RowMajorFill(int x, int y, QColor colorClicked, QColor toolColor){
21
-
22
-
21
+     for (int i = x; i<getGridColumns() && (getCellColor(i,y) == colorClicked) ; i++)
22
+            switchOn(i, y, toolColor);
23
+    
24
+     for (int i = (x-1); i>=0 && (getCellColor(i,y) == colorClicked) ; i--)
25
+            switchOn(i, y, toolColor);
23 26
 }
24 27
 
25 28