comparison view/View.cpp @ 1326:97c68bffbda6 zoom

More ZoomLevel updates
author Chris Cannam
date Thu, 20 Sep 2018 10:45:24 +0100
parents 13d9b422f7fe
children 646e713a4632
comparison
equal deleted inserted replaced
1325:bc2cb82050a0 1326:97c68bffbda6
52 52
53 View::View(QWidget *w, bool showProgress) : 53 View::View(QWidget *w, bool showProgress) :
54 QFrame(w), 54 QFrame(w),
55 m_id(getNextId()), 55 m_id(getNextId()),
56 m_centreFrame(0), 56 m_centreFrame(0),
57 m_zoomLevel(1024), 57 m_zoomLevel(ZoomLevel::FramesPerPixel, 1024),
58 m_followPan(true), 58 m_followPan(true),
59 m_followZoom(true), 59 m_followZoom(true),
60 m_followPlay(PlaybackScrollPageWithCentre), 60 m_followPlay(PlaybackScrollPageWithCentre),
61 m_followPlayIsDetached(false), 61 m_followPlayIsDetached(false),
62 m_playPointerFrame(0), 62 m_playPointerFrame(0),
63 m_showProgress(showProgress), 63 m_showProgress(showProgress),
64 m_cache(0), 64 m_cache(0),
65 m_buffer(0), 65 m_buffer(0),
66 m_cacheCentreFrame(0), 66 m_cacheCentreFrame(0),
67 m_cacheZoomLevel(1024), 67 m_cacheZoomLevel(ZoomLevel::FramesPerPixel, 1024),
68 m_selectionCached(false), 68 m_selectionCached(false),
69 m_deleting(false), 69 m_deleting(false),
70 m_haveSelectedLayer(false), 70 m_haveSelectedLayer(false),
71 m_manager(0), 71 m_manager(0),
72 m_propertyContainer(new ViewPropertyContainer(this)) 72 m_propertyContainer(new ViewPropertyContainer(this))
317 } 317 }
318 318
319 void 319 void
320 View::setStartFrame(sv_frame_t f) 320 View::setStartFrame(sv_frame_t f)
321 { 321 {
322 setCentreFrame(f + m_zoomLevel * (width() / 2)); 322 setCentreFrame(f + sv_frame_t(round
323 (m_zoomLevel.pixelsToFrames(width() / 2))));
323 } 324 }
324 325
325 bool 326 bool
326 View::setCentreFrame(sv_frame_t f, bool e) 327 View::setCentreFrame(sv_frame_t f, bool e)
327 { 328 {