mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-09-26 10:23:12 +08:00
Fix style preview size per resolution
This commit is contained in:
parent
eede1f1e9c
commit
b67c4785f0
@ -3582,7 +3582,7 @@ GuiCfg create_gui_configuration()
|
|||||||
float space = line_height_with_spacing - line_height;
|
float space = line_height_with_spacing - line_height;
|
||||||
const ImGuiStyle &style = ImGui::GetStyle();
|
const ImGuiStyle &style = ImGui::GetStyle();
|
||||||
|
|
||||||
cfg.max_style_name_width = ImGui::CalcTextSize("Maximal font name, extended").x;
|
cfg.max_style_name_width = ImGui::CalcTextSize("Maximal style name..").x;
|
||||||
|
|
||||||
cfg.icon_width = static_cast<unsigned int>(std::ceil(line_height));
|
cfg.icon_width = static_cast<unsigned int>(std::ceil(line_height));
|
||||||
// make size pair number
|
// make size pair number
|
||||||
@ -3701,7 +3701,7 @@ GuiCfg create_gui_configuration()
|
|||||||
ImVec2(cfg.minimal_window_size_with_advance.x,
|
ImVec2(cfg.minimal_window_size_with_advance.x,
|
||||||
cfg.minimal_window_size_with_advance.y + input_height);
|
cfg.minimal_window_size_with_advance.y + input_height);
|
||||||
|
|
||||||
int max_style_image_width = static_cast<int>(std::round(cfg.max_style_name_width/2 - 2 * style.FramePadding.x));
|
int max_style_image_width = static_cast<int>(std::round(cfg.max_style_name_width - 2 * style.FramePadding.x));
|
||||||
int max_style_image_height = static_cast<int>(std::round(1.5 * input_height));
|
int max_style_image_height = static_cast<int>(std::round(1.5 * input_height));
|
||||||
cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height);
|
cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height);
|
||||||
cfg.face_name_size = Vec2i(cfg.input_width, line_height_with_spacing);
|
cfg.face_name_size = Vec2i(cfg.input_width, line_height_with_spacing);
|
||||||
|
@ -46,12 +46,12 @@ void CreateFontStyleImagesJob::process(Ctl &ctl)
|
|||||||
// create image description
|
// create image description
|
||||||
StyleManager::StyleImage &image = m_images[index];
|
StyleManager::StyleImage &image = m_images[index];
|
||||||
BoundingBox &bounding_box = image.bounding_box;
|
BoundingBox &bounding_box = image.bounding_box;
|
||||||
for (ExPolygon &shape : shapes)
|
for (const ExPolygon &shape : shapes)
|
||||||
bounding_box.merge(BoundingBox(shape.contour.points));
|
bounding_box.merge(BoundingBox(shape.contour.points));
|
||||||
for (ExPolygon &shape : shapes) shape.translate(-bounding_box.min);
|
for (ExPolygon &shape : shapes) shape.translate(-bounding_box.min);
|
||||||
|
|
||||||
// calculate conversion from FontPoint to screen pixels by size of font
|
// calculate conversion from FontPoint to screen pixels by size of font
|
||||||
double scale = get_text_shape_scale(item.prop, *item.font.font_file);
|
double scale = get_text_shape_scale(item.prop, *item.font.font_file) * m_input.ppm;
|
||||||
scales[index] = scale;
|
scales[index] = scale;
|
||||||
|
|
||||||
//double scale = font_prop.size_in_mm * SCALING_FACTOR;
|
//double scale = font_prop.size_in_mm * SCALING_FACTOR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user