Skip to content

Commit

Permalink
Correct (?) draw function
Browse files Browse the repository at this point in the history
'ts the reason we have tests
  • Loading branch information
TheVaffel committed Feb 6, 2022
1 parent 233f6d7 commit a9c682f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HGraf/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ namespace hg {

int di[2] = {pe[0] - ps[0], pe[1] - ps[1]};
if(std::abs(di[0]) > 2*canvas.getWidth() || std::abs(di[1]) > 2*canvas.getHeight()) {
if(std::abs(ps[0]) > canvas.getWidth() || std::abs(ps[1] > canvas.getHeight())) {
if(std::abs(ps[0]) > canvas.getWidth() || std::abs(ps[1]) > canvas.getHeight()) {
int msb_wh = std::max(msb(canvas.getWidth()), msb(canvas.getHeight()));
int msb_ps = std::min(msb(ps[0]), msb(ps[1])); //Most significant bit of ps
int shift = msb_ps - msb_wh - 1;
Expand Down

0 comments on commit a9c682f

Please sign in to comment.