Fixed a bug in drawer dc
This commit is contained in:
parent
d633f9751d
commit
393300cea7
34
Drawer.cpp
34
Drawer.cpp
@ -64,6 +64,8 @@ void Drawer::composeBoard(const TLVec& layout, const Dimensions& gridSize) {
|
|||||||
drawTile(dc, c, fromGrid(x, y), z);
|
drawTile(dc, c, fromGrid(x, y), z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dc.SelectObject(wxNullBitmap);
|
||||||
|
|
||||||
wxMask* mask = new wxMask(boardBitmap, wxColor(0x00, 0x00, 0x00));
|
wxMask* mask = new wxMask(boardBitmap, wxColor(0x00, 0x00, 0x00));
|
||||||
boardBitmap.SetMask(mask);
|
boardBitmap.SetMask(mask);
|
||||||
}
|
}
|
||||||
@ -131,26 +133,24 @@ bool Drawer::resizeBoard(const TLVec& layout, const Dimensions& gridSize) {
|
|||||||
|
|
||||||
wxLogDebug(wxString::Format("Resize board: %i", gridPoint));
|
wxLogDebug(wxString::Format("Resize board: %i", gridPoint));
|
||||||
|
|
||||||
if (gridPoint >= MIN_GRID_POINT) {
|
if (gridPoint != prevGridPoint) {
|
||||||
if (gridPoint != prevGridPoint) {
|
tablePixelRect.SetSize({gridPoint * TILE_WIDTH * gridSize.x,
|
||||||
tablePixelRect.SetSize({gridPoint * TILE_WIDTH * gridSize.x,
|
gridPoint * TILE_HEIGHT * gridSize.y});
|
||||||
gridPoint * TILE_HEIGHT * gridSize.y});
|
|
||||||
|
|
||||||
tilePixelSize.Set(gridPoint * TILE_WIDTH, gridPoint * TILE_HEIGHT);
|
tilePixelSize.Set(gridPoint * TILE_WIDTH, gridPoint * TILE_HEIGHT);
|
||||||
}
|
|
||||||
|
|
||||||
tablePixelRect.SetPosition(
|
|
||||||
{(resolution.x - tablePixelRect.width) / 2,
|
|
||||||
(resolution.y - tablePixelRect.height) / 2});
|
|
||||||
|
|
||||||
if (gridPoint != prevGridPoint) {
|
|
||||||
composeBoard(layout, gridSize);
|
|
||||||
res = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
prevGridPoint = gridPoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tablePixelRect.SetPosition(
|
||||||
|
{(resolution.x - tablePixelRect.width) / 2,
|
||||||
|
(resolution.y - tablePixelRect.height) / 2});
|
||||||
|
|
||||||
|
if (gridPoint != prevGridPoint) {
|
||||||
|
composeBoard(layout, gridSize);
|
||||||
|
res = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
prevGridPoint = gridPoint;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user