Skip to content

Commit

Permalink
drm3d: fix coordinate in uterm_display_fill, finally fixed margin col…
Browse files Browse the repository at this point in the history
…or issue
  • Loading branch information
Aetf authored and Aetf committed Jan 3, 2018
1 parent e3fe727 commit dac3c31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/uterm_drm3d_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,14 @@ int uterm_drm3d_display_fill(struct uterm_display *disp,
if (tmp > sh)
height = sh - y;

/* Caution:
* opengl uses a coordinate system with the origin at _lower-left_ corner
* and positive y-axis up, while other parts uses a coordinate system
* with the origin at _upper-left_ corner and positive y-axis down.
*/
y = sh - y; // invert y-axis
y -= height; // move origin to lower left corner

glViewport(x, y, width, height);
glDisable(GL_BLEND);

Expand Down

0 comments on commit dac3c31

Please sign in to comment.