MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / setDefaultScroll

Method setDefaultScroll

src/app/ui/editor/editor.cpp:379–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void Editor::setDefaultScroll()
380{
381 View* view = View::getView(this);
382 Rect vp = view->viewportBounds();
383
384 setEditorScroll(
385 gfx::Point(
386 m_padding.x - vp.w/2 + m_zoom.apply(m_sprite->width())/2,
387 m_padding.y - vp.h/2 + m_zoom.apply(m_sprite->height())/2));
388}
389
390// Sets the scroll position of the editor
391void Editor::setEditorScroll(const gfx::Point& scroll)

Callers 2

onAddDocumentMethod · 0.80
onExecuteMethod · 0.80

Calls 5

PointClass · 0.85
viewportBoundsMethod · 0.80
applyMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected