Fixed double painting of letters on grid
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -47,5 +47,7 @@ Debug
|
||||
*.cpp.o
|
||||
*.cpp.o.d
|
||||
|
||||
*.d
|
||||
|
||||
#Release folder is NOT code!
|
||||
Release
|
||||
@@ -2,10 +2,10 @@
|
||||
<CodeLite_Workspace Name="CrossGen" Database="">
|
||||
<Project Name="wxCrossGen" Path="wxCrossGen/wxCrossGen.project" Active="Yes"/>
|
||||
<BuildMatrix>
|
||||
<WorkspaceConfiguration Name="Debug" Selected="no">
|
||||
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
||||
<Project Name="wxCrossGen" ConfigName="Debug"/>
|
||||
</WorkspaceConfiguration>
|
||||
<WorkspaceConfiguration Name="Release" Selected="yes">
|
||||
<WorkspaceConfiguration Name="Release" Selected="no">
|
||||
<Project Name="wxCrossGen" ConfigName="Release"/>
|
||||
</WorkspaceConfiguration>
|
||||
</BuildMatrix>
|
||||
|
||||
@@ -119,16 +119,35 @@ void MainFrame::SetGridImage(GridType &grid, size_t w) {
|
||||
}
|
||||
|
||||
if (_words.size() > 0) {
|
||||
using std::vector;
|
||||
vector< vector< bool > > usedCells(
|
||||
grid.size(),
|
||||
vector<bool>(grid.at(0).size(), false)
|
||||
);
|
||||
cur_f = dc.GetFont();
|
||||
cur_f.SetPointSize(sq_h*0.6);
|
||||
dc.SetFont(cur_f);
|
||||
for (size_t i = 0; i < winfos.size(); ++i){
|
||||
if (winfos.at(i).direct == true){
|
||||
for (size_t j = 0; j < winfos.at(i).len; ++j)
|
||||
dc.DrawText(_words.at(i).at(j),sq_w*(winfos.at(i).x+j)+sq_w*0.24, sq_h*winfos.at(i).y);
|
||||
if ( !usedCells.at(i).at(j) ){
|
||||
dc.DrawText(
|
||||
_words.at(i).at(j),
|
||||
sq_w*(winfos.at(i).x+j) + sq_w*0.24,
|
||||
sq_h*winfos.at(i).y
|
||||
);
|
||||
usedCells.at(i).at(j) = true;
|
||||
}
|
||||
} else {
|
||||
for (size_t j = 0; j < winfos.at(i).len; ++j)
|
||||
dc.DrawText(_words.at(i).at(j),sq_w*winfos.at(i).x+sq_w*0.24, sq_h*(winfos.at(i).y+j));
|
||||
if ( !usedCells.at(i).at(j) ){
|
||||
dc.DrawText(
|
||||
_words.at(i).at(j),
|
||||
sq_w*winfos.at(i).x + sq_w*0.24,
|
||||
sq_h*(winfos.at(i).y+j)
|
||||
);
|
||||
usedCells.at(i).at(j) = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ CurrentFileName :=
|
||||
CurrentFilePath :=
|
||||
CurrentFileFullPath :=
|
||||
User :=Aleksey Lobanov
|
||||
Date :=31/05/15
|
||||
Date :=06/06/15
|
||||
CodeLitePath :="/home/alex/.codelite"
|
||||
LinkerName :=/usr/bin/g++-4.8
|
||||
SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC
|
||||
|
||||
Reference in New Issue
Block a user