Best effort for pixel perfect icon rendering (#4552)

* Make sure all icons & toolbars have sizes & locations in whole number pixels, so icons won't be blurry

* Make every size even so it scales well on screen
This commit is contained in:
Noisyfox 2024-05-18 22:49:03 +08:00 committed by GitHub
parent 136313f539
commit ba3016bc3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 19 deletions

View file

@ -1101,10 +1101,10 @@ void GLGizmosManager::do_render_overlay() const
//float space_width = GLGizmosManager::Default_Icons_Size * wxGetApp().toolbar_icon_scale();
//float zoomed_top_x = 0.5f *(cnv_w + main_toolbar_width - 2 * space_width - width) * inv_zoom;
float main_toolbar_left = -0.5f * cnv_w + m_parent.get_main_toolbar_offset();
int main_toolbar_left = -cnv_w + m_parent.get_main_toolbar_offset() * 2;
//float zoomed_top_x = 0.5f *(main_toolbar_width + collapse_width - width - assemble_view_width) * inv_zoom;
top_x = main_toolbar_left + main_toolbar_width + separator_width / 2;
top_x = top_x * inv_cnv_w * 2;
top_x = main_toolbar_left + main_toolbar_width * 2 + separator_width;
top_x = top_x * inv_cnv_w;
}
float top_y = 1.0f;