MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / ResetScrollBar

Method ResetScrollBar

LibLemon/src/gui/widgets.cpp:347–354  ·  view source on GitHub ↗

///////////////////// Scroll Bar /////////////////////

Source from the content-addressed store, hash-verified

345 // Scroll Bar
346 //////////////////////////
347 void ScrollBar::ResetScrollBar(int displayHeight, int areaHeight){
348 double scrollDisplayRange = ((double)areaHeight) / displayHeight; // Essentially how many 'displayHeight's in areaHeight
349 scrollIncrement = ceil(scrollDisplayRange);
350 scrollBar.size.y = displayHeight / scrollDisplayRange;
351 scrollBar.pos.y = 0;
352 scrollPos = 0;
353 height = displayHeight;
354 }
355
356 void ScrollBar::Paint(surface_t* surface, vector2i_t offset, int width){
357 Graphics::DrawRect(offset.x, offset.y, width, height, 128, 128, 128, surface);

Callers 3

UpdateFixedBoundsMethod · 0.80
CanvasMethod · 0.80
ResetScrollbarsMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected