summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-24bit.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-24bit.c')
-rw-r--r--firmware/drivers/lcd-24bit.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/firmware/drivers/lcd-24bit.c b/firmware/drivers/lcd-24bit.c
index 65fa01f37f..5ee290efe3 100644
--- a/firmware/drivers/lcd-24bit.c
+++ b/firmware/drivers/lcd-24bit.c
@@ -869,11 +869,11 @@ void lcd_hline(int x1, int x2, int y)
869 869
870 /******************** In viewport clipping **********************/ 870 /******************** In viewport clipping **********************/
871 /* nothing to draw? */ 871 /* nothing to draw? */
872 if (((unsigned)y >= (unsigned)lcd_current_viewport->height) || 872 if (((unsigned)y >= (unsigned)lcd_current_viewport->height) ||
873 (x1 >= lcd_current_viewport->width) || 873 (x1 >= lcd_current_viewport->width) ||
874 (x2 < 0)) 874 (x2 < 0))
875 return; 875 return;
876 876
877 if (x1 < 0) 877 if (x1 < 0)
878 x1 = 0; 878 x1 = 0;
879 if (x2 >= lcd_current_viewport->width) 879 if (x2 >= lcd_current_viewport->width)
@@ -883,14 +883,14 @@ void lcd_hline(int x1, int x2, int y)
883 x1 += lcd_current_viewport->x; 883 x1 += lcd_current_viewport->x;
884 x2 += lcd_current_viewport->x; 884 x2 += lcd_current_viewport->x;
885 y += lcd_current_viewport->y; 885 y += lcd_current_viewport->y;
886 886
887#if defined(HAVE_VIEWPORT_CLIP) 887#if defined(HAVE_VIEWPORT_CLIP)
888 /********************* Viewport on screen clipping ********************/ 888 /********************* Viewport on screen clipping ********************/
889 /* nothing to draw? */ 889 /* nothing to draw? */
890 if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH) 890 if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
891 || (x2 < 0)) 891 || (x2 < 0))
892 return; 892 return;
893 893
894 /* clipping */ 894 /* clipping */
895 if (x1 < 0) 895 if (x1 < 0)
896 x1 = 0; 896 x1 = 0;
@@ -935,19 +935,19 @@ void lcd_vline(int x, int y1, int y2)
935 y1 = 0; 935 y1 = 0;
936 if (y2 >= lcd_current_viewport->height) 936 if (y2 >= lcd_current_viewport->height)
937 y2 = lcd_current_viewport->height-1; 937 y2 = lcd_current_viewport->height-1;
938 938
939 /* adjust for viewport */ 939 /* adjust for viewport */
940 x += lcd_current_viewport->x; 940 x += lcd_current_viewport->x;
941 y1 += lcd_current_viewport->y; 941 y1 += lcd_current_viewport->y;
942 y2 += lcd_current_viewport->y; 942 y2 += lcd_current_viewport->y;
943 943
944#if defined(HAVE_VIEWPORT_CLIP) 944#if defined(HAVE_VIEWPORT_CLIP)
945 /********************* Viewport on screen clipping ********************/ 945 /********************* Viewport on screen clipping ********************/
946 /* nothing to draw? */ 946 /* nothing to draw? */
947 if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT) 947 if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT)
948 || (y2 < 0)) 948 || (y2 < 0))
949 return; 949 return;
950 950
951 /* clipping */ 951 /* clipping */
952 if (y1 < 0) 952 if (y1 < 0)
953 y1 = 0; 953 y1 = 0;
@@ -978,7 +978,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
978 if ((width <= 0) || (height <= 0) || (x >= lcd_current_viewport->width) || 978 if ((width <= 0) || (height <= 0) || (x >= lcd_current_viewport->width) ||
979 (y >= lcd_current_viewport->height) || (x + width <= 0) || (y + height <= 0)) 979 (y >= lcd_current_viewport->height) || (x + width <= 0) || (y + height <= 0))
980 return; 980 return;
981 981
982 if (x < 0) 982 if (x < 0)
983 { 983 {
984 width += x; 984 width += x;
@@ -991,23 +991,23 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
991 src_y -= y; 991 src_y -= y;
992 y = 0; 992 y = 0;
993 } 993 }
994 994
995 if (x + width > lcd_current_viewport->width) 995 if (x + width > lcd_current_viewport->width)
996 width = lcd_current_viewport->width - x; 996 width = lcd_current_viewport->width - x;
997 if (y + height > lcd_current_viewport->height) 997 if (y + height > lcd_current_viewport->height)
998 height = lcd_current_viewport->height - y; 998 height = lcd_current_viewport->height - y;
999 999
1000 /* adjust for viewport */ 1000 /* adjust for viewport */
1001 x += lcd_current_viewport->x; 1001 x += lcd_current_viewport->x;
1002 y += lcd_current_viewport->y; 1002 y += lcd_current_viewport->y;
1003 1003
1004#if defined(HAVE_VIEWPORT_CLIP) 1004#if defined(HAVE_VIEWPORT_CLIP)
1005 /********************* Viewport on screen clipping ********************/ 1005 /********************* Viewport on screen clipping ********************/
1006 /* nothing to draw? */ 1006 /* nothing to draw? */
1007 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 1007 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
1008 || (x + width <= 0) || (y + height <= 0)) 1008 || (x + width <= 0) || (y + height <= 0))
1009 return; 1009 return;
1010 1010
1011 /* clip image in viewport in screen */ 1011 /* clip image in viewport in screen */
1012 if (x < 0) 1012 if (x < 0)
1013 { 1013 {
@@ -1026,7 +1026,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
1026 if (y + height > LCD_HEIGHT) 1026 if (y + height > LCD_HEIGHT)
1027 height = LCD_HEIGHT - y; 1027 height = LCD_HEIGHT - y;
1028#endif 1028#endif
1029 1029
1030 src += stride * src_y + src_x; /* move starting point */ 1030 src += stride * src_y + src_x; /* move starting point */
1031 dst = FBADDR(x, y); 1031 dst = FBADDR(x, y);
1032 1032
@@ -1052,7 +1052,7 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
1052 if ((width <= 0) || (height <= 0) || (x >= lcd_current_viewport->width) || 1052 if ((width <= 0) || (height <= 0) || (x >= lcd_current_viewport->width) ||
1053 (y >= lcd_current_viewport->height) || (x + width <= 0) || (y + height <= 0)) 1053 (y >= lcd_current_viewport->height) || (x + width <= 0) || (y + height <= 0))
1054 return; 1054 return;
1055 1055
1056 if (x < 0) 1056 if (x < 0)
1057 { 1057 {
1058 width += x; 1058 width += x;
@@ -1065,23 +1065,23 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
1065 src_y -= y; 1065 src_y -= y;
1066 y = 0; 1066 y = 0;
1067 } 1067 }
1068 1068
1069 if (x + width > lcd_current_viewport->width) 1069 if (x + width > lcd_current_viewport->width)
1070 width = lcd_current_viewport->width - x; 1070 width = lcd_current_viewport->width - x;
1071 if (y + height > lcd_current_viewport->height) 1071 if (y + height > lcd_current_viewport->height)
1072 height = lcd_current_viewport->height - y; 1072 height = lcd_current_viewport->height - y;
1073 1073
1074 /* adjust for viewport */ 1074 /* adjust for viewport */
1075 x += lcd_current_viewport->x; 1075 x += lcd_current_viewport->x;
1076 y += lcd_current_viewport->y; 1076 y += lcd_current_viewport->y;
1077 1077
1078#if defined(HAVE_VIEWPORT_CLIP) 1078#if defined(HAVE_VIEWPORT_CLIP)
1079 /********************* Viewport on screen clipping ********************/ 1079 /********************* Viewport on screen clipping ********************/
1080 /* nothing to draw? */ 1080 /* nothing to draw? */
1081 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 1081 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
1082 || (x + width <= 0) || (y + height <= 0)) 1082 || (x + width <= 0) || (y + height <= 0))
1083 return; 1083 return;
1084 1084
1085 /* clip image in viewport in screen */ 1085 /* clip image in viewport in screen */
1086 if (x < 0) 1086 if (x < 0)
1087 { 1087 {