Skip to content

Commit 5f936a2

Browse files
committed
update version
1 parent cf6a8aa commit 5f936a2

File tree

4 files changed

+125
-134
lines changed

4 files changed

+125
-134
lines changed

GuiLite.h

+55-54
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,60 @@ class c_font_operator
828828
virtual void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) = 0;
829829
virtual void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) = 0;
830830
virtual int get_str_size(const void* string, const void* font, int& width, int& height) = 0;
831+
void get_string_pos(const void* string, const void* font, c_rect rect, unsigned int align_type, int& x, int& y)
832+
{
833+
int x_size, y_size;
834+
get_str_size(string, font, x_size, y_size);
835+
int height = rect.m_bottom - rect.m_top + 1;
836+
int width = rect.m_right - rect.m_left + 1;
837+
x = y = 0;
838+
switch (align_type & ALIGN_HMASK)
839+
{
840+
case ALIGN_HCENTER:
841+
//m_text_org_x=0
842+
if (width > x_size)
843+
{
844+
x = (width - x_size) / 2;
845+
}
846+
break;
847+
case ALIGN_LEFT:
848+
x = 0;
849+
break;
850+
case ALIGN_RIGHT:
851+
//m_text_org_x=0
852+
if (width > x_size)
853+
{
854+
x = width - x_size;
855+
}
856+
break;
857+
default:
858+
ASSERT(0);
859+
break;
860+
}
861+
switch (align_type & ALIGN_VMASK)
862+
{
863+
case ALIGN_VCENTER:
864+
//m_text_org_y=0
865+
if (height > y_size)
866+
{
867+
y = (height - y_size) / 2;
868+
}
869+
break;
870+
case ALIGN_TOP:
871+
y = 0;
872+
break;
873+
case ALIGN_BOTTOM:
874+
//m_text_org_y=0
875+
if (height > y_size)
876+
{
877+
y = height - y_size;
878+
}
879+
break;
880+
default:
881+
ASSERT(0);
882+
break;
883+
}
884+
}
831885
};
832886
class c_lattice_font_op: public c_font_operator
833887
{
@@ -1004,60 +1058,7 @@ class c_lattice_font_op: public c_font_operator
10041058
}
10051059
return 0;
10061060
}
1007-
void get_string_pos(const char *s, const LATTICE_FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y)
1008-
{
1009-
int x_size, y_size;
1010-
get_str_size(s, font, x_size, y_size);
1011-
int height = rect.m_bottom - rect.m_top + 1;
1012-
int width = rect.m_right - rect.m_left + 1;
1013-
x = y = 0;
1014-
switch (align_type & ALIGN_HMASK)
1015-
{
1016-
case ALIGN_HCENTER:
1017-
//m_text_org_x=0
1018-
if (width > x_size)
1019-
{
1020-
x = (width - x_size) / 2;
1021-
}
1022-
break;
1023-
case ALIGN_LEFT:
1024-
x = 0;
1025-
break;
1026-
case ALIGN_RIGHT:
1027-
//m_text_org_x=0
1028-
if (width > x_size)
1029-
{
1030-
x = width - x_size;
1031-
}
1032-
break;
1033-
default:
1034-
ASSERT(0);
1035-
break;
1036-
}
1037-
switch (align_type & ALIGN_VMASK)
1038-
{
1039-
case ALIGN_VCENTER:
1040-
//m_text_org_y=0
1041-
if (height > y_size)
1042-
{
1043-
y = (height - y_size) / 2;
1044-
}
1045-
break;
1046-
case ALIGN_TOP:
1047-
y = 0;
1048-
break;
1049-
case ALIGN_BOTTOM:
1050-
//m_text_org_y=0
1051-
if (height > y_size)
1052-
{
1053-
y = height - y_size;
1054-
}
1055-
break;
1056-
default:
1057-
ASSERT(0);
1058-
break;
1059-
}
1060-
}
1061+
10611062
static int get_utf8_code(const char* s, unsigned int& output_utf8_code)
10621063
{
10631064
static unsigned char s_utf8_length_table[256] =

workspace/.sync.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ curl --include --request POST --header "Content-Type: application/json" --data-b
4242
\"city\" :\"$city\",
4343
\"org\" :\"$org\",
4444
\"log\" :\"$build_time\",
45-
\"version\" :\"v2.0\"
45+
\"version\" :\"v2.1\"
4646
}]" $url > /dev/null

workspace/core_include/word.h

+56-66
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,61 @@ class c_font_operator
1717
virtual void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const void* font, unsigned int font_color, unsigned int bg_color) = 0;
1818
virtual void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const void* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT) = 0;
1919
virtual int get_str_size(const void* string, const void* font, int& width, int& height) = 0;
20+
21+
void get_string_pos(const void* string, const void* font, c_rect rect, unsigned int align_type, int& x, int& y)
22+
{
23+
int x_size, y_size;
24+
get_str_size(string, font, x_size, y_size);
25+
int height = rect.m_bottom - rect.m_top + 1;
26+
int width = rect.m_right - rect.m_left + 1;
27+
x = y = 0;
28+
switch (align_type & ALIGN_HMASK)
29+
{
30+
case ALIGN_HCENTER:
31+
//m_text_org_x=0
32+
if (width > x_size)
33+
{
34+
x = (width - x_size) / 2;
35+
}
36+
break;
37+
case ALIGN_LEFT:
38+
x = 0;
39+
break;
40+
case ALIGN_RIGHT:
41+
//m_text_org_x=0
42+
if (width > x_size)
43+
{
44+
x = width - x_size;
45+
}
46+
break;
47+
default:
48+
ASSERT(0);
49+
break;
50+
}
51+
switch (align_type & ALIGN_VMASK)
52+
{
53+
case ALIGN_VCENTER:
54+
//m_text_org_y=0
55+
if (height > y_size)
56+
{
57+
y = (height - y_size) / 2;
58+
}
59+
break;
60+
case ALIGN_TOP:
61+
y = 0;
62+
break;
63+
case ALIGN_BOTTOM:
64+
//m_text_org_y=0
65+
if (height > y_size)
66+
{
67+
y = height - y_size;
68+
}
69+
break;
70+
default:
71+
ASSERT(0);
72+
break;
73+
}
74+
}
2075
};
2176

2277
class c_lattice_font_op: public c_font_operator
@@ -204,72 +259,7 @@ class c_lattice_font_op: public c_font_operator
204259
}
205260
return 0;
206261
}
207-
208-
void get_string_pos(const char *s, const LATTICE_FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y)
209-
{
210-
int x_size, y_size;
211-
get_str_size(s, font, x_size, y_size);
212-
213-
int height = rect.m_bottom - rect.m_top + 1;
214-
int width = rect.m_right - rect.m_left + 1;
215-
216-
x = y = 0;
217-
218-
switch (align_type & ALIGN_HMASK)
219-
{
220-
case ALIGN_HCENTER:
221-
//m_text_org_x=0
222-
if (width > x_size)
223-
{
224-
x = (width - x_size) / 2;
225-
}
226-
break;
227-
228-
case ALIGN_LEFT:
229-
x = 0;
230-
break;
231-
232-
case ALIGN_RIGHT:
233-
//m_text_org_x=0
234-
if (width > x_size)
235-
{
236-
x = width - x_size;
237-
}
238-
break;
239-
240-
default:
241-
ASSERT(0);
242-
break;
243-
}
244-
245-
switch (align_type & ALIGN_VMASK)
246-
{
247-
case ALIGN_VCENTER:
248-
//m_text_org_y=0
249-
if (height > y_size)
250-
{
251-
y = (height - y_size) / 2;
252-
}
253-
break;
254-
255-
case ALIGN_TOP:
256-
y = 0;
257-
break;
258-
259-
case ALIGN_BOTTOM:
260-
//m_text_org_y=0
261-
if (height > y_size)
262-
{
263-
y = height - y_size;
264-
}
265-
break;
266-
267-
default:
268-
ASSERT(0);
269-
break;
270-
}
271-
}
272-
262+
273263
static int get_utf8_code(const char* s, unsigned int& output_utf8_code)
274264
{
275265
static unsigned char s_utf8_length_table[256] =

workspace/sync_build.bat

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
echo off
2-
setlocal enabledelayedexpansion
2+
setlocal
33

44
set argC=0
5-
for %%x in (%*) do Set /A argC+=1
5+
for %%x in (%*) do set /A argC+=1
66
if NOT "1" == "%argC%" (
77
echo "Invalidate arguments"
88
goto :eof
@@ -15,16 +15,16 @@ for /f %%x in ('wmic path win32_utctime get /format:list ^| findstr "="') do (
1515
set %%x
1616
)
1717

18-
Set Second=0%Second%
19-
Set Second=%Second:~-2%
20-
Set Minute=0%Minute%
21-
Set Minute=%Minute:~-2%
22-
Set Hour=0%Hour%
23-
Set Hour=%Hour:~-2%
24-
Set Day=0%Day%
25-
Set Day=%Day:~-2%
26-
Set Month=0%Month%
27-
Set Month=%Month:~-2%
18+
set Second=0%Second%
19+
set Second=%Second:~-2%
20+
set Minute=0%Minute%
21+
set Minute=%Minute:~-2%
22+
set Hour=0%Hour%
23+
set Hour=%Hour:~-2%
24+
set Day=0%Day%
25+
set Day=%Day:~-2%
26+
set Month=0%Month%
27+
set Month=%Month:~-2%
2828
set datetime=%Year%-%Month%-%Day%T%Hour%:%Minute%:%Second%.000+0000
2929

3030
::----------------- for GEO info -----------------
@@ -66,7 +66,7 @@ set raw_data=[{^
6666
\"city\" :\"%city%\",^
6767
\"org\" :\"%org%\",^
6868
\"log\" :\"%datetime%\",^
69-
\"version\" :\"v2.0\"^
69+
\"version\" :\"v2.1\"^
7070
}]
7171

7272
curl.exe --include --request POST --header "Content-Type: application/json" --data-binary "%raw_data%" "%url%"

0 commit comments

Comments
 (0)