MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / scrollContainer

Method scrollContainer

customScrollContainer.cpp:142–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void ScrollAreaCustom::scrollContainer(){
143 //scroll
144 if(curSpd > 0){
145 if(curSpd > MAXSPEED && !ignoreMaxSpeed)
146 curSpd = MAXSPEED;
147 else if(curSpd <= MAXSPEED) ignoreMaxSpeed = false;
148 int dp = scrollDown ? curSpd : -curSpd;
149 container->move(container->x(), container->y() + dp);
150 }
151 else
152 return;
153 if(container->y() <= 0 && container->y() + container->height() >= this->height()){
154 curSpd -= damp;
155 curSpd = curSpd < 0 ? 0 : curSpd;
156 }
157 else
158 curSpd /= 2;
159 if(curSpd == 0 && (container->y() > 0 || container->y() + container->height() < this->height()))
160 bounceBack();
161 else
162 rfrshView->start(30);
163}
164
165void ScrollAreaCustom::updateSpd(){
166 int spd = lastY - strtY;

Callers

nothing calls this directly

Calls 1

moveMethod · 0.80

Tested by

no test coverage detected