Merge pull request #1265 from pete-pjb/dev-6.1

Dev 6.1 Minor fixes
This commit is contained in:
Gabor Kiss-Vamosi
2019-11-13 07:39:59 +01:00
committed by GitHub
4 changed files with 4 additions and 77 deletions

View File

@@ -90,11 +90,11 @@ void lv_style_init(void)
lv_style_scr.body.shadow.color = LV_COLOR_GRAY;
lv_style_scr.body.shadow.type = LV_SHADOW_FULL;
lv_style_scr.body.shadow.width = 0;
LV_FONT_DECLARE(lv_font_heb_16);
lv_style_scr.text.opa = LV_OPA_COVER;
lv_style_scr.text.color = lv_color_make(0x30, 0x30, 0x30);
lv_style_scr.text.sel_color = lv_color_make(0x55, 0x96, 0xd8);
lv_style_scr.text.font = &lv_font_heb_16;//LV_FONT_DEFAULT;
lv_style_scr.text.font = LV_FONT_DEFAULT;
lv_style_scr.text.letter_space = 0;
lv_style_scr.text.line_space = 2;

View File

@@ -215,79 +215,6 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, cons
}
}
static uint16_t fast_atan2(int x, int y)
{
// Fast XY vector to integer degree algorithm - Jan 2011 www.RomanBlack.com
// Converts any XY values including 0 to a degree value that should be
// within +/- 1 degree of the accurate value without needing
// large slow trig functions like ArcTan() or ArcCos().
// NOTE! at least one of the X or Y values must be non-zero!
// This is the full version, for all 4 quadrants and will generate
// the angle in integer degrees from 0-360.
// Any values of X and Y are usable including negative values provided
// they are between -1456 and 1456 so the 16bit multiply does not overflow.
unsigned char negflag;
unsigned char tempdegree;
unsigned char comp;
unsigned int degree; /*this will hold the result*/
unsigned int ux;
unsigned int uy;
/*Save the sign flags then remove signs and get XY as unsigned ints*/
negflag = 0;
if(x < 0) {
negflag += 0x01; /*x flag bit*/
x = (0 - x); /*is now +*/
}
ux = x; /*copy to unsigned var before multiply*/
if(y < 0) {
negflag += 0x02; /*y flag bit*/
y = (0 - y); /*is now +*/
}
uy = y; /*copy to unsigned var before multiply*/
/*1. Calc the scaled "degrees"*/
if(ux > uy) {
degree = (uy * 45) / ux; /*degree result will be 0-45 range*/
negflag += 0x10; /*octant flag bit*/
} else {
degree = (ux * 45) / uy; /*degree result will be 0-45 range*/
}
/*2. Compensate for the 4 degree error curve*/
comp = 0;
tempdegree = degree; /*use an unsigned char for speed!*/
if(tempdegree > 22) { /*if top half of range*/
if(tempdegree <= 44) comp++;
if(tempdegree <= 41) comp++;
if(tempdegree <= 37) comp++;
if(tempdegree <= 32) comp++; /*max is 4 degrees compensated*/
} else { /*else is lower half of range*/
if(tempdegree >= 2) comp++;
if(tempdegree >= 6) comp++;
if(tempdegree >= 10) comp++;
if(tempdegree >= 15) comp++; /*max is 4 degrees compensated*/
}
degree += comp; /*degree is now accurate to +/- 1 degree!*/
/*Invert degree if it was X>Y octant, makes 0-45 into 90-45*/
if(negflag & 0x10) degree = (90 - degree);
/*3. Degree is now 0-90 range for this quadrant,*/
/*need to invert it for whichever quadrant it was in*/
if(negflag & 0x02) { /*if -Y*/
if(negflag & 0x01) /*if -Y -X*/
degree = (180 + degree);
else /*else is -Y +X*/
degree = (180 - degree);
} else { /*else is +Y*/
if(negflag & 0x01) /*if +Y -X*/
degree = (360 - degree);
}
return degree;
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -1,4 +1,4 @@
#include "lvgl/lvgl.h"
#include "../../lvgl.h"
/*******************************************************************************
* Size: 16 px

View File

@@ -731,7 +731,7 @@ uint16_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos)
if(bidi_txt[new_line_start] == '\0') txt_len--;
lv_bidi_process_paragraph(txt + line_start, bidi_txt, txt_len, lv_obj_get_base_dir(label), NULL, 0);
#else
bidi_txt = txt + line_start;
bidi_txt = (char*)txt + line_start;
#endif
/*Calculate the x coordinate*/