Release v0.6.25: recognize pencil strokes as straight lines

This commit is contained in:
2026-11-01 23:00:59 +02:00
parent 20f3b72287
commit 908985d775
11 changed files with 80 additions and 21 deletions
+3 -1
View File
@@ -1537,12 +1537,14 @@ LRESULT CALLBACK captureProc(HWND w, UINT msg, WPARAM wp, LPARAM lp)
!c->marks.back().fromNumber && !c->marks.back().toNumber &&
!c->marks.back().fromLink.target && !c->marks.back().toLink.target) {
ScreenshotShape recognized{};
auto improved=improveScreenshotStroke(c->marks.back().points,&recognized);
bool straightLine=false;
auto improved=improveScreenshotStroke(c->marks.back().points,&recognized,&straightLine);
if(!improved.empty()) {
c->remember(c->marks);
auto &mark=c->marks.back();
mark.points=std::move(improved);
mark.from=mark.points.front(); mark.to=mark.points.back();
if(straightLine) { mark.points.clear(); mark.freehand=false; }
if(recognized!=ScreenshotShape::None) {
mark.shape=recognized; mark.freehand=false; mark.ends=LineEnds::None;
auto bounds=markBounds(mark);