diff --git a/src/gui/PageView.cpp b/src/gui/PageView.cpp index 4f1dc758..b5db9b3f 100644 --- a/src/gui/PageView.cpp +++ b/src/gui/PageView.cpp @@ -887,11 +887,11 @@ bool XojPageView::actionDelete() return false; } -bool XojPageView::paintPage(cairo_t* cr, GdkRectangle* rect) +bool XojPageView::paintPage(cairo_t* cr, GdkRectangle* rect, double scalingFactor) { XOJ_CHECK_TYPE(XojPageView); - static const char* txtLoading = _C("Loading..."); + static const string txtLoading = _("Loading..."); double zoom = xournal->getZoom(); @@ -914,10 +914,10 @@ bool XojPageView::paintPage(cairo_t* cr, GdkRectangle* rect) cairo_set_source_rgb(cr2, 0.5, 0.5, 0.5); cairo_select_font_face(cr2, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr2, 32.0); - cairo_text_extents(cr2, txtLoading, &ex); + cairo_text_extents(cr2, txtLoading.c_str(), &ex); cairo_move_to(cr2, (page->getWidth() - ex.width) / 2 - ex.x_bearing, (page->getHeight() - ex.height) / 2 - ex.y_bearing); - cairo_show_text(cr2, txtLoading); + cairo_show_text(cr2, txtLoading.c_str()); cairo_destroy(cr2); rerenderPage(); diff --git a/src/gui/PageView.h b/src/gui/PageView.h index 9d1812ec..db57d38b 100644 --- a/src/gui/PageView.h +++ b/src/gui/PageView.h @@ -145,7 +145,7 @@ public: // event handler * This method actually repaints the XojPageView, triggering * a rerender call if necessary */ - bool paintPage(cairo_t* cr, GdkRectangle* rect); + bool paintPage(cairo_t* cr, GdkRectangle* rect, double scalingFactor); public: // listener void rectChanged(Rectangle& rect); diff --git a/src/gui/widgets/XournalWidget.cpp b/src/gui/widgets/XournalWidget.cpp index 3ff539d1..31db5958 100644 --- a/src/gui/widgets/XournalWidget.cpp +++ b/src/gui/widgets/XournalWidget.cpp @@ -738,6 +738,11 @@ static gboolean gtk_xournal_draw(GtkWidget* widget, cairo_t* cr) Rectangle clippingRect(x1 - 10, y1 - 10, x2 - x1 + 20, y2 - y1 + 20); + // This scaling factor is an int, but e.g. Ubuntu allow to configure + // float values in the settings, may this settings can be used + // but probably reported by another function + double scalingFactor = gtk_widget_get_scale_factor(widget); + while (it.hasNext()) { XojPageView* pv = it.next(); @@ -757,7 +762,7 @@ static gboolean gtk_xournal_draw(GtkWidget* widget, cairo_t* cr) cairo_save(cr); cairo_translate(cr, px, py); - pv->paintPage(cr, NULL); + pv->paintPage(cr, NULL, scalingFactor); cairo_restore(cr); }