Implement Pen/Highlighter Cursor correct size

This Commit changes the Pen/Highlighter Cursor to have the form of a
circle (via `cairo_arc`) and also uses the set size to give a correct
impression on how big the line one is about to draw is.
presentation
tobidot 6 years ago
parent 99371a25e9
commit 511d296939
  1. 5
      src/gui/XournalppCursor.cpp

@ -421,9 +421,10 @@ auto XournalppCursor::createHighlighterOrPenCursor(int size, double alpha) -> Gd
cairo_stroke(cr);
}
cairo_set_source_rgba(cr, r, g, b, alpha);
// Correct the offset of the coloured dot for big-cursor mode
cairo_rectangle(cr, centerX, centerY, size, size);
double cursorSize = control->getToolHandler()->getThickness() * control->getZoomControl()->getZoom();
cairo_arc(cr, centerX, centerY, cursorSize/2., 0, 2. * M_PI);
cairo_fill(cr);
cairo_destroy(cr);
GdkPixbuf* pixbuf = xoj_pixbuf_get_from_surface(crCursor, 0, 0, width, height);

Loading…
Cancel
Save