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

Method Canvas

Applications/LemonPaint/canvas.cpp:5–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <math.h>
4
5Canvas::Canvas(rect_t _bounds, vector2i_t canvasSize) {
6 bounds = _bounds;
7
8 surface.buffer = (uint8_t*)malloc(canvasSize.x*canvasSize.y*4);
9 surface.width = canvasSize.x;
10 surface.height = canvasSize.y;
11
12 sBarVert.ResetScrollBar(bounds.size.y - 16, canvasSize.y);
13 sBarHor.ResetScrollBar(bounds.size.x - 16, canvasSize.x);
14}
15
16void Canvas::DragBrush(vector2i_t a, vector2i_t b){
17 double xDist = b.x - a.x;

Callers

nothing calls this directly

Calls 1

ResetScrollBarMethod · 0.80

Tested by

no test coverage detected