Mercurial > hg > svgui
comparison view/Overview.cpp @ 1183:57d192e26331 zoom
Some hackery toward having a zoomlevel type
author | Chris Cannam |
---|---|
date | Mon, 12 Dec 2016 15:18:52 +0000 |
parents | 73b0dc7d6ec1 |
children | 13d9b422f7fe |
comparison
equal
deleted
inserted
replaced
1182:6605984fa98f | 1183:57d192e26331 |
---|---|
45 Overview::modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame) | 45 Overview::modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame) |
46 { | 46 { |
47 bool zoomChanged = false; | 47 bool zoomChanged = false; |
48 | 48 |
49 sv_frame_t frameCount = getModelsEndFrame() - getModelsStartFrame(); | 49 sv_frame_t frameCount = getModelsEndFrame() - getModelsStartFrame(); |
50 int zoomLevel = int(frameCount / width()); | 50 ZoomLevel zoomLevel { ZoomLevel::FramesPerPixel, int(frameCount / width()) }; |
51 if (zoomLevel < 1) zoomLevel = 1; | 51 if (zoomLevel.level < 1) zoomLevel.level = 1; |
52 zoomLevel = getZoomConstraintBlockSize(zoomLevel, | 52 zoomLevel = getZoomConstraintBlockSize(zoomLevel, ZoomConstraint::RoundUp); |
53 ZoomConstraint::RoundUp); | |
54 if (zoomLevel != m_zoomLevel) { | 53 if (zoomLevel != m_zoomLevel) { |
55 zoomChanged = true; | 54 zoomChanged = true; |
56 } | 55 } |
57 | 56 |
58 if (!zoomChanged) { | 57 if (!zoomChanged) { |