screenshot tools baked-in: drawing uses optimized qcanvaspainter, direct to clipboard, eliminate forking to swappy
C++ / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 21s
JS/TS / fmt (pull_request) Successful in 20s
Python / lint (pull_request) Successful in 31s
Python / fmt (pull_request) Successful in 33s
Python / typecheck (pull_request) Failing after 1m4s
Python / test (pull_request) Successful in 1m7s
C++ / build (pull_request) Successful in 1m48s
Rust / fmt (pull_request) Successful in 37s
Rust / build (pull_request) Successful in 1m42s
Python / buildcheck (pull_request) Successful in 2m33s
Rust / clippy (pull_request) Successful in 1m32s
C++ / clang-tidy (pull_request) Successful in 3m35s
C++ / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 21s
JS/TS / fmt (pull_request) Successful in 20s
Python / lint (pull_request) Successful in 31s
Python / fmt (pull_request) Successful in 33s
Python / typecheck (pull_request) Failing after 1m4s
Python / test (pull_request) Successful in 1m7s
C++ / build (pull_request) Successful in 1m48s
Rust / fmt (pull_request) Successful in 37s
Rust / build (pull_request) Successful in 1m42s
Python / buildcheck (pull_request) Successful in 2m33s
Rust / clippy (pull_request) Successful in 1m32s
C++ / clang-tidy (pull_request) Successful in 3m35s
This commit is contained in:
@@ -8,7 +8,8 @@ static void drawStroke(
|
||||
QCanvasPainter* painter,
|
||||
const QVector<QPointF>& points,
|
||||
const QColor& color,
|
||||
qreal width) {
|
||||
qreal width,
|
||||
bool polyline) {
|
||||
if (points.isEmpty()) return;
|
||||
|
||||
painter->setStrokeStyle(color);
|
||||
@@ -17,6 +18,15 @@ static void drawStroke(
|
||||
painter->setLineCap(QCanvasPainter::LineCap::Round);
|
||||
painter->setLineJoin(QCanvasPainter::LineJoin::Round);
|
||||
|
||||
if (polyline) {
|
||||
painter->beginPath();
|
||||
painter->moveTo(points[0]);
|
||||
for (int i = 1; i < points.size(); i++)
|
||||
painter->lineTo(points[i]);
|
||||
painter->stroke();
|
||||
return;
|
||||
}
|
||||
|
||||
if (points.size() == 1) {
|
||||
painter->beginPath();
|
||||
painter->circle(points.front(), width * 0.5);
|
||||
@@ -180,7 +190,8 @@ void StrokeCanvasRenderer::paint(QCanvasPainter* painter) {
|
||||
painter,
|
||||
m_currentStroke.points,
|
||||
m_currentStroke.color,
|
||||
m_currentStroke.width);
|
||||
m_currentStroke.width,
|
||||
m_currentStroke.isPolyline);
|
||||
|
||||
if (m_hoverVisible)
|
||||
drawHoverCursor(
|
||||
|
||||
Reference in New Issue
Block a user