UI: Show SVG Thumbnails with Checkerboard Backgrounds
Show checkerboard background behind SVG thumbnails just as we do for other image types. Pull Request: https://projects.blender.org/blender/blender/pulls/110036
This commit is contained in:
committed by
Harley Acheson
parent
a3e05f06a6
commit
5f7e07e053
@@ -357,8 +357,8 @@ static void file_draw_preview(const FileList *files,
|
||||
float scaledx, scaledy;
|
||||
float scale;
|
||||
int ex, ey;
|
||||
bool show_outline = !is_icon &&
|
||||
(file->typeflag & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_BLENDER));
|
||||
bool show_outline = !is_icon && (file->typeflag & (FILE_TYPE_IMAGE | FILE_TYPE_OBJECT_IO |
|
||||
FILE_TYPE_MOVIE | FILE_TYPE_BLENDER));
|
||||
const bool is_offline = (file->attributes & FILE_ATTR_OFFLINE);
|
||||
const bool is_loading = !filelist_is_ready(files) || file->flags & FILE_ENTRY_PREVIEW_LOADING;
|
||||
|
||||
@@ -417,7 +417,7 @@ static void file_draw_preview(const FileList *files,
|
||||
document_img_col[3] *= 0.3f;
|
||||
}
|
||||
|
||||
if (!is_icon && file->typeflag & FILE_TYPE_IMAGE) {
|
||||
if (!is_icon && ELEM(file->typeflag, FILE_TYPE_IMAGE, FILE_TYPE_OBJECT_IO)) {
|
||||
/* Draw checker pattern behind image previews in case they have transparency. */
|
||||
imm_draw_box_checker_2d(float(xco), float(yco), float(xco + ex), float(yco + ey));
|
||||
}
|
||||
@@ -574,7 +574,7 @@ static void file_draw_preview(const FileList *files,
|
||||
GPUVertFormat *format = immVertexFormat();
|
||||
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
float border_color[4] = {1.0f, 1.0f, 1.0f, 0.4f};
|
||||
float border_color[4] = {1.0f, 1.0f, 1.0f, 0.15f};
|
||||
float bgcolor[4];
|
||||
UI_GetThemeColor4fv(TH_BACK, bgcolor);
|
||||
if (rgb_to_grayscale(bgcolor) > 0.5f) {
|
||||
@@ -583,7 +583,7 @@ static void file_draw_preview(const FileList *files,
|
||||
border_color[2] = 0.0f;
|
||||
}
|
||||
immUniformColor4fv(border_color);
|
||||
imm_draw_box_wire_2d(pos, float(xco), float(yco), float(xco + ex), float(yco + ey));
|
||||
imm_draw_box_wire_2d(pos, float(xco), float(yco), float(xco + ex + 1), float(yco + ey + 1));
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user