Skip to content

Commit

Permalink
fix WMeasurePaintDevice not properly initializing underlying device
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Deforche committed Sep 11, 2014
1 parent 27107e8 commit 1646a7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Wt/WDoubleValidator.C
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ std::string WDoubleValidator::javaScriptValidate() const
<< isMandatory()
<< ',';

if (bottom_ != -std::numeric_limits<double>::max())
if (bottom_ != -std::numeric_limits<double>::max() &&
bottom_ != -std::numeric_limits<double>::infinity())
js << bottom_;
else
js << "null";

js << ',';

if (top_ != std::numeric_limits<double>::max())
if (top_ != std::numeric_limits<double>::max() &&
top_ != std::numeric_limits<double>::infinity())
js << top_;
else
js << "null";
Expand Down
2 changes: 2 additions & 0 deletions src/Wt/WMeasurePaintDevice.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ void WMeasurePaintDevice::init()
{
if (!device_->painter()) {
device_->setPainter(painter_);
device_->init();
} else
device_->painter()->save();
}

void WMeasurePaintDevice::done()
{
if (painter_ == device_->painter()) {
device_->done();
device_->setPainter(0);
} else
device_->painter()->restore();
Expand Down

0 comments on commit 1646a7c

Please sign in to comment.