MCPcopy Create free account
hub / github.com/city-super/Octree-GS / updateDrag

Method updateDrag

SIBR_viewers/src/core/view/interface/Interface.cpp:605–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603 }
604
605 void MultiViewInterface::updateDrag(const sibr::Input & input, const sibr::Vector2f & winSize)
606 {
607 if (input.mouseButton().isPressed(sibr::Mouse::Left)) {
608 drag.isActive = true;
609 drag.position = input.mousePosition();
610 drag.center = viewRectangle.center;
611 } else if (drag.isActive && input.mouseButton().isReleased(sibr::Mouse::Left)) {
612 drag.isActive = false;
613 }
614 if (drag.isActive && input.mouseButton().isActivated(sibr::Mouse::Left)) {
615 sibr::Vector2f translation = (input.mousePosition() - drag.position).cast<float>().cwiseQuotient(winSize).cwiseProduct(viewRectangle.br() - viewRectangle.tl());
616 translation.y() = -translation.y();
617 viewRectangle.center = drag.center - translation;
618 }
619 }
620
621
622 void MultiViewInterfaceView::onUpdate(Input & input, const sibr::Viewport & viewport)

Callers

nothing calls this directly

Calls 5

isPressedMethod · 0.80
isReleasedMethod · 0.80
isActivatedMethod · 0.80
brMethod · 0.45
tlMethod · 0.45

Tested by

no test coverage detected