mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly disable all animations
This seems to be needed for the correct print of the profile, What was happening on the print code was that the profile even in print mode was doing animations, and we were getting a frame of it and trying to print it. Also, a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3fa908b242
commit
2171b981ac
6 changed files with 36 additions and 19 deletions
|
@ -120,10 +120,15 @@ int PrintLayout::estimateTotalDives() const
|
|||
void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||
{
|
||||
int i, row = 0, col = 0, printed = 0, total = estimateTotalDives();
|
||||
bool animationOriginal = prefs.animation;
|
||||
|
||||
struct dive *dive;
|
||||
if (!total)
|
||||
return;
|
||||
|
||||
// disable animations on the profile:
|
||||
prefs.animation = false;
|
||||
|
||||
// setup a painter
|
||||
QPainter painter;
|
||||
painter.begin(printer);
|
||||
|
@ -205,6 +210,8 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
|||
profile->resize(originalSize);
|
||||
// we need to force a redraw of the profile so it switches back from print mode
|
||||
profile->plotDive(0, true);
|
||||
// re-enable animations
|
||||
prefs.animation = animationOriginal;
|
||||
}
|
||||
|
||||
/* we create a table that has a fixed height, but can stretch to fit certain width */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue