Skip to content

Commit

Permalink
Initialize lastSeenZoom (#953)
Browse files Browse the repository at this point in the history
CSCalableBitmap didn't initialize this member so the generation of
clean bitmaps was comparing with an unset variable. This may be
what causes #952, although I am having a hard time reproducing it
reliably. But lets push this fix and see if it fixes it for dave.
  • Loading branch information
baconpaul authored Jul 11, 2019
1 parent a6b15cf commit c69fe9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/common/gui/CScalableBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ CScalableBitmap::CScalableBitmap(CResourceDescription desc, VSTGUI::CFrame* f)

extraScaleFactor = 100;
currentPhysicalZoomFactor = 100;
lastSeenZoom = -1;
}

#define DUMPR(r) \
Expand Down Expand Up @@ -222,8 +223,8 @@ void CScalableBitmap::draw (CDrawContext* context, const CRect& rect, const CPoi
lastSeenZoom = currentPhysicalZoomFactor;
}

CGraphicsTransform tf =
CGraphicsTransform().scale(lastSeenZoom / 100.0, lastSeenZoom / 100.0);
CGraphicsTransform tf = CGraphicsTransform().scale(lastSeenZoom / 100.0, lastSeenZoom / 100.0);

/*
** VSTGUI has this wierdo bug where it shrinks backgrounds properly but doesn't grow them. Sigh.
** So asymmetrically treat the extra factor here and only here.
Expand All @@ -234,6 +235,7 @@ void CScalableBitmap::draw (CDrawContext* context, const CRect& rect, const CPoi
CGraphicsTransform itf = tf.inverse();
CGraphicsTransform ixtf = xtf.inverse();


if (offscreenCache.find(offset) == offscreenCache.end())
{
VSTGUI::CPoint sz = rect.getSize();
Expand Down
2 changes: 0 additions & 2 deletions src/common/gui/SurgeBitmaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ using namespace VSTGUI;

SurgeBitmaps::SurgeBitmaps()
{
std::cout << "Constructing a registry" << std::endl;
}

SurgeBitmaps::~SurgeBitmaps()
{
std::cout << "Destroying a registry" << std::endl;
for (auto pair : bitmap_registry)
{
pair.second->forget();
Expand Down

0 comments on commit c69fe9d

Please sign in to comment.