refactor(application): remove scaling logic

This commit is contained in:
Jeremy Attali 2020-06-16 22:35:25 -04:00
parent ad564ebc33
commit 7a9be5d2a6
2 changed files with 2 additions and 6 deletions

View File

@ -214,8 +214,6 @@ struct swappy_state {
cairo_rectangle_int_t *drawing_area_rect;
gint scaling_factor;
GList *paints;
GList *redo_paints;
struct swappy_paint *temp_paint;

View File

@ -545,14 +545,11 @@ static void compute_window_size(struct swappy_state *state) {
GdkDisplay *display = gdk_display_get_default();
GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(state->ui->window));
GdkMonitor *monitor = gdk_display_get_monitor_at_window(display, window);
gint scaling_factor = gdk_window_get_scale_factor(window);
gdk_monitor_get_workarea(monitor, &workarea);
g_info("scale_factor: %d", scaling_factor);
g_info("size of monitor at window: %ux%u", workarea.width, workarea.height);
g_assert(workarea.width > 0);
g_assert(workarea.height > 0);
state->scaling_factor = scaling_factor;
state->window = g_new(struct swappy_box, 1);
state->window->x = workarea.x;
state->window->y = workarea.y;
@ -569,6 +566,7 @@ static void compute_window_size(struct swappy_state *state) {
state->window->width = state->geometry->width * scaling;
state->window->height = state->geometry->height * scaling;
g_info("size of monitor at window: %ux%u", workarea.width, workarea.height);
g_info("size of window to render: %ux%u", state->window->width,
state->window->height);
}