summaryrefslogtreecommitdiffstats
path: root/minuitwrp/graphics.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2019-03-19 17:39:38 +0100
committerEthan Yonker <dees_troy@teamw.in>2019-03-19 17:40:28 +0100
commite03158ebdd9fb8858d4debde4196765ccdcb0972 (patch)
treeb38b29224db87b6dcff98093f0f360b46226368f /minuitwrp/graphics.cpp
parentFull screen action: simplify by just hiding navbar (diff)
downloadandroid_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar.gz
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar.bz2
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar.lz
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar.xz
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.tar.zst
android_bootable_recovery-e03158ebdd9fb8858d4debde4196765ccdcb0972.zip
Diffstat (limited to '')
-rw-r--r--minuitwrp/graphics.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/minuitwrp/graphics.cpp b/minuitwrp/graphics.cpp
index 0abcb0c53..47ff3b917 100644
--- a/minuitwrp/graphics.cpp
+++ b/minuitwrp/graphics.cpp
@@ -113,18 +113,18 @@ int gr_textEx_scaleW(int x, int y, const char *s, void* pFont, int max_width, in
void gr_clip(int x, int y, int w, int h)
{
GGLContext *gl = gr_context;
- int x0_disp, y0_disp, x1_disp, y1_disp;
- int l_disp, r_disp, t_disp, b_disp;
- x0_disp = ROTATION_X_DISP(x, y, gr_draw);
- y0_disp = ROTATION_Y_DISP(x, y, gr_draw);
- x1_disp = ROTATION_X_DISP(x + w, y + h, gr_draw);
- y1_disp = ROTATION_Y_DISP(x + w, y + h, gr_draw);
- l_disp = std::min(x0_disp, x1_disp);
- r_disp = std::max(x0_disp, x1_disp);
- t_disp = std::min(y0_disp, y1_disp);
- b_disp = std::max(y0_disp, y1_disp);
- gl->scissor(gl, l_disp, t_disp, r_disp, b_disp);
+#if TW_ROTATION == 0
+ gl->scissor(gl, x, y, w, h);
+#elif TW_ROTATION == 90
+ gl->scissor(gl, gr_draw->width - y - h, x, h, w);
+#elif TW_ROTATION == 270
+ gl->scissor(gl, y, gr_draw->height - x - w, h, w);
+#else
+ int t_disp = gr_draw->height - y - h;
+ int l_disp = gr_draw->width - x - w;
+ gl->scissor(gl, l_disp, t_disp, w, h);
+#endif
gl->enable(gl, GGL_SCISSOR_TEST);
}