Skip to content

Commit ae4e137

Browse files
committed
resize fix
1 parent 5473fc0 commit ae4e137

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WinFormsCellLifeSimulationApp/SimDrawController.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,7 @@ void SimDrawController::draw(std::vector<SimulationModel::drawEntity> entities)
166166

167167
void SimDrawController::fitSimSize()
168168
{
169-
if (sim != nullptr)sim->setSize(pictureBox->Size.Width, pictureBox->Size.Height);
169+
if (sim != nullptr && pictureBox->Size.Width > 0 && pictureBox->Size.Height > 0) {
170+
sim->setSize(pictureBox->Size.Width, pictureBox->Size.Height);
171+
}
170172
}

0 commit comments

Comments
 (0)