Fix a remap problem on brush, when modified by Lua script then transformed. Fix Brush remap to maintain transparent pixels. Fix Text tool , respects transparent pixels and preview is always visible (The black PF_ fonts are no longer shown on a black background)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1726 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2011-02-16 17:03:45 +00:00
parent 2378d8cedc
commit 80c37034f9
8 changed files with 95 additions and 15 deletions

View File

@@ -4867,9 +4867,22 @@ void Button_Text(void)
if (str[0])
preview_string=str;
is_truetype=TrueType_font(selected_font_index);
Window_rectangle(8, 106, 273, 50,(antialias&&is_truetype)?MC_Black:Back_color);
free(new_brush);
new_brush = Render_text(preview_string, selected_font_index, font_size, antialias, is_bold, is_italic, &new_width, &new_height, text_palette);
// Background:
if (antialias&&is_truetype)
// Solid
Window_rectangle(8, 106, 273, 50,MC_Black);
else if (is_truetype)
{
long l = text_palette[Fore_color].R+text_palette[Fore_color].G+text_palette[Fore_color].B;
Window_rectangle(8, 106, 273, 50,l>128*3? MC_Black:MC_Light);
}
else
{
long l = text_palette[Back_color].R+text_palette[Back_color].G+text_palette[Back_color].B;
Window_rectangle(8, 106, 273, 50,l>128*3? MC_Light:MC_Black);
}
if (new_brush)
{
if (!is_truetype || (is_truetype&&antialias))
@@ -4906,7 +4919,7 @@ void Button_Text(void)
//if (r==Main_palette[color].R && g==Main_palette[color].G && b==Main_palette[color].B)
// colmap[color]=color;
//else
colmap[color]=Best_color_perceptual(r,g,b);
colmap[color]=Best_color_perceptual_except(r,g,b,Back_color);
}
colmap[Back_color]=Back_color;