purge widecolor of RtL and LtR direction changes #25

This commit is contained in:
nick black 2019-11-25 19:36:02 -05:00 committed by Nick Black
parent 5220836798
commit 190b38dc97
4 changed files with 23 additions and 12 deletions

View File

@ -8,6 +8,7 @@ int box_demo(struct notcurses* nc){
struct ncplane* n = notcurses_stdplane(nc);
cell ul, ll, lr, ur, hl, vl;
ncplane_fg_rgb8(n, 255, 255, 255);
ncplane_bg_rgb8(n, 180, 40, 180);
cell_init(&ul);
cell_init(&ur);
cell_init(&ll);
@ -20,11 +21,23 @@ int box_demo(struct notcurses* nc){
cell_load(n, &lr, "");
cell_load(n, &vl, "");
cell_load(n, &hl, "");
cell_set_fg(&ul, 107, 40, 107);
cell_set_bg(&ul, 20, 20, 20);
cell_set_fg(&ur, 107, 40, 107);
cell_set_bg(&ur, 20, 20, 20);
cell_set_fg(&hl, 107, 40, 107);
cell_set_bg(&hl, 20, 20, 20);
cell_set_fg(&ll, 20, 20, 20);
cell_set_bg(&ll, 107, 40, 107);
cell_set_fg(&lr, 20, 20, 20);
cell_set_bg(&lr, 107, 40, 107);
cell_set_fg(&vl, 20, 20, 20);
cell_set_bg(&vl, 107, 40, 107);
int y = 0, x = 0;
while(ymax - y - 1 > 2 && xmax - x - 1 > 2){
ncplane_cursor_move_yx(n, y, x);
if(ncplane_cursor_move_yx(n, y, x)){
return -1;
}
if(ncplane_box(n, &ul, &ur, &ll, &lr, &hl, &vl, ymax, xmax)){
return -1;
}

View File

@ -21,15 +21,15 @@ ext_demos(struct notcurses* nc){
if(maxcolor_demo(nc)){
return -1;
}
if(box_demo(nc)){
return -1;
}
if(unicodeblocks_demo(nc)){
return -1;
}
if(grid_demo(nc)){
return -1;
}
if(box_demo(nc)){
return -1;
}
if(widecolor_demo(nc)){
return -1;
}

View File

@ -85,7 +85,7 @@ int maxcolor_demo(struct notcurses* nc){
if(notcurses_render(nc)){
return -1;
}
sleep(3);
sleep(2);
cell_release(n, &ul);
cell_release(n, &ur);
cell_release(n, &ll);

View File

@ -37,10 +37,9 @@ int widecolor_demo(struct notcurses* nc){
"⑤ Господ слезе да ги види градот и кулата, што луѓето ги градеа.",
"⑥ И҆ речѐ гдⷭ҇ь: сѐ, ро́дъ є҆ди́нъ, и҆ ѹ҆стнѣ̀ є҆ди҄нѣ всѣ́хъ, и҆ сїѐ нача́ша твори́ти: и҆ нн҃ѣ не ѡ҆скꙋдѣ́ютъ ѿ ни́хъ всѧ҄, є҆ли҄ка а́҆ще восхотѧ́тъ твори́ти.",
"⑦ Ⱂⱃⰻⰻⰴⱑⱅⰵ ⰺ ⰺⰸⱎⰵⰴⱎⰵ ⱄⰿⱑⱄⰻⰿⱏ ⰺⰿⱏ ⱅⱆ ⱔⰸⱏⰹⰽⰻ ⰺⱈⱏ · ⰴⰰ ⱀⰵ ⱆⱄⰾⱏⰹⱎⰰⱅⱏ ⰽⱁⰶⰴⱁ ⰴⱃⱆⰳⰰ ⱄⰲⱁⰵⰳⱁ ⁖⸏",
"काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम्",
"काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम्",
"kācaṃ śaknomyattum; nopahinasti mām",
"ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει",
"Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα",
"Μπορῶ νὰ φάω σπασμένα γυαλιὰ χωρὶς νὰ πάθω τίποτα",
"Vitrum edere possum; mihi non nocet",
"Je puis mangier del voirre. Ne me nuit",
@ -95,8 +94,8 @@ int widecolor_demo(struct notcurses* nc){
"Jag kan äta glas utan att skada mig",
"Jeg kan spise glas, det gør ikke ondt på mig",
"Æ ka æe glass uhen at det go mæ naue",
"က္ယ္ဝန္တော္၊က္ယ္ဝန္မ မ္ယက္စားနုိင္သည္။ ၎က္ရောင္‌့ ထိခုိက္မ္ဟု မရ္ဟိပာ။ (9",
"ကျွန်တော် ကျွန်မ မှန်စားနိုင်တယ်။ ၎င်းကြောင့် ထိခိုက်မှုမရှိပါ။ (",
"က္ယ္ဝန္တော္၊က္ယ္ဝန္မ မ္ယက္စားနုိင္သည္။ ၎က္ရောင္ ထိခုိက္မ္ဟု မရ္ဟိပာ။",
"ကျွန်တော် ကျွန်မ မှန်စားနိုင်တယ်။ ၎င်းကြောင့် ထိခိုက်မှုမရှိပါ။ ",
"Tôi có thể ăn thủy tinh mà không hại gì",
"些 𣎏 世 咹 水 晶 𦓡 空 𣎏 害",
"ខ្ញុំអាចញុំកញ្ចក់បាន ដោយគ្មានបញ្ហា",
@ -104,7 +103,7 @@ int widecolor_demo(struct notcurses* nc){
"ฉันกินกระจกได้ แต่มันไม่ทำให้ฉันเจ็",
"Би шил идэй чадна, надад хортой би",
"ᠪᠢ ᠰᠢᠯᠢ ᠢᠳᠡᠶᠦ ᠴᠢᠳᠠᠨᠠ ᠂ ᠨᠠᠳᠤᠷ ᠬᠣᠤᠷᠠᠳᠠᠢ ᠪᠢᠰ",
"म काँच खान सक्छू र मलाई केहि नी हुन्न्",
"म काँच खान सक्छू र मलाई केहि नी हुन्न्",
"ཤེལ་སྒོ་ཟ་ནས་ང་ན་གི་མ་རེད",
"我能吞下玻璃而不伤身体",
"我能吞下玻璃而不傷身體",
@ -225,8 +224,7 @@ int widecolor_demo(struct notcurses* nc){
cell_set_style(&wch, WA_NORMAL);
cell_set_fg(&wch, cell_rgb_red(rgb), 255 - cell_rgb_green(rgb),
cell_rgb_blue(rgb));
cell_set_bg(&wch, 255 - cell_rgb_red(rgb),
cell_rgb_green(rgb), 255 - cell_rgb_blue(rgb));
cell_set_bg(&wch, 64, 64, 64);
size_t idx = 0;
while((*s)[idx]){
if(y >= maxy && x >= maxx){