pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/editors/xournalpp
Module Name: pkgsrc
Committed By: nia
Date: Sat Nov 2 14:44:15 UTC 2019
Modified Files:
pkgsrc/editors/xournalpp: Makefile distinfo
Added Files:
pkgsrc/editors/xournalpp/patches:
patch-src_control_tools_StrokeHandler.cpp
patch-src_util_DeviceListHelper.cpp
Log Message:
xournalpp: Add smooth curves and device manager patches, from wip/xournalpp-git
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/editors/xournalpp/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/editors/xournalpp/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/editors/xournalpp/patches/patch-src_control_tools_StrokeHandler.cpp \
pkgsrc/editors/xournalpp/patches/patch-src_util_DeviceListHelper.cpp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/editors/xournalpp/Makefile
diff -u pkgsrc/editors/xournalpp/Makefile:1.3 pkgsrc/editors/xournalpp/Makefile:1.4
--- pkgsrc/editors/xournalpp/Makefile:1.3 Sun Oct 20 11:10:48 2019
+++ pkgsrc/editors/xournalpp/Makefile Sat Nov 2 14:44:15 2019
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2019/10/20 11:10:48 nia Exp $
+# $NetBSD: Makefile,v 1.4 2019/11/02 14:44:15 nia Exp $
DISTNAME= xournalpp-1.0.15
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_GITHUB:=xournalpp/}
GITHUB_PROJECT= xournalpp
Index: pkgsrc/editors/xournalpp/distinfo
diff -u pkgsrc/editors/xournalpp/distinfo:1.1 pkgsrc/editors/xournalpp/distinfo:1.2
--- pkgsrc/editors/xournalpp/distinfo:1.1 Wed Oct 16 13:34:08 2019
+++ pkgsrc/editors/xournalpp/distinfo Sat Nov 2 14:44:15 2019
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.1 2019/10/16 13:34:08 nia Exp $
+$NetBSD: distinfo,v 1.2 2019/11/02 14:44:15 nia Exp $
SHA1 (xournalpp-1.0.15.tar.gz) = 6934c8de1260ca580988c421c55c2a44999a235c
RMD160 (xournalpp-1.0.15.tar.gz) = 8f53fd4b74507e28e28a4fffa9fe4d8c5f434c45
SHA512 (xournalpp-1.0.15.tar.gz) = 7a015c1d48e26eed313f994aa293f6d2ab711ac6970568edef4ba10dcf1551c87279daa2b361731ac58ef236e1dd59e0eebf41e4739fba9db954a718450d5b79
Size (xournalpp-1.0.15.tar.gz) = 14938798 bytes
SHA1 (patch-CMakeLists.txt) = 52b9a70a3242b618f8092b94a21c276c522e749d
+SHA1 (patch-src_control_tools_StrokeHandler.cpp) = 80df57a9776a9919a95a04bf6c057dc021fc789e
+SHA1 (patch-src_util_DeviceListHelper.cpp) = 8f3534c80c79ec49dd9562c3ed4e3ff7c36b2ecb
Added files:
Index: pkgsrc/editors/xournalpp/patches/patch-src_control_tools_StrokeHandler.cpp
diff -u /dev/null pkgsrc/editors/xournalpp/patches/patch-src_control_tools_StrokeHandler.cpp:1.1
--- /dev/null Sat Nov 2 14:44:15 2019
+++ pkgsrc/editors/xournalpp/patches/patch-src_control_tools_StrokeHandler.cpp Sat Nov 2 14:44:15 2019
@@ -0,0 +1,46 @@
+$NetBSD: patch-src_control_tools_StrokeHandler.cpp,v 1.1 2019/11/02 14:44:15 nia Exp $
+
+On NetBSD, absolute coordinate changes are reported as an X value followed by a Y value,
+which (when moving quickly) leads to a "stepping" effect. Using a Bezier curve fitting
+for the points yields a smooth curve in most cases, and does not seem to adversely affect
+the user experience (even with a conventional mouse).
+
+--- ./src/control/tools/StrokeHandler.cpp.orig 2019-09-10 05:47:36.000000000 +0000
++++ ./src/control/tools/StrokeHandler.cpp
+@@ -115,9 +115,36 @@ bool StrokeHandler::onMotionNotifyEvent(
+ }
+ else
+ {
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++ if (pointCount > 1)
++#else
+ if (pointCount > 0)
++#endif
+ {
+ Point prevPoint(stroke->getPoint(pointCount - 1));
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++ double length, prevLength, t, x, y;
++ Point pprevPoint(stroke->getPoint(pointCount - 2));
++
++ // treat this point as an end point
++ // treat the previous point as a control point and recalculate the "actual" point
++ prevLength = prevPoint.lineLengthTo(pprevPoint);
++ length = prevLength + currentPoint.lineLengthTo(prevPoint);
++ if (length != 0)
++ {
++ t = prevLength/length;
++ // Bezier curve fitting
++ x = (1-t)*(1-t)*pprevPoint.x + 2*t*(1-t)*prevPoint.x + t*t*currentPoint.x;
++ y = (1-t)*(1-t)*pprevPoint.y + 2*t*(1-t)*prevPoint.y + t*t*currentPoint.y;
++
++ prevPoint = Point(x,y,prevPoint.z);
++ stroke->deletePointsFrom(pointCount-1);
++ stroke->addPoint(prevPoint);
++ stroke->addPoint(currentPoint);
++ currentPoint = prevPoint;
++ prevPoint = pprevPoint;
++ }
++#endif
+
+ Stroke lastSegment;
+
Index: pkgsrc/editors/xournalpp/patches/patch-src_util_DeviceListHelper.cpp
diff -u /dev/null pkgsrc/editors/xournalpp/patches/patch-src_util_DeviceListHelper.cpp:1.1
--- /dev/null Sat Nov 2 14:44:15 2019
+++ pkgsrc/editors/xournalpp/patches/patch-src_util_DeviceListHelper.cpp Sat Nov 2 14:44:15 2019
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_util_DeviceListHelper.cpp,v 1.1 2019/11/02 14:44:15 nia Exp $
+
+This check seems to skip devices that are reasonable to include (on NetBSD), so rather
+list all devices and let the user manage them.
+
+--- src/util/DeviceListHelper.cpp.orig 2019-08-13 08:34:36.000000000 +0000
++++ src/util/DeviceListHelper.cpp
+@@ -31,7 +31,8 @@ void addDevicesToList(std::vector<InputD
+ devList = devList->next;
+ continue;
+ }
+- if (gdk_device_get_vendor_id(dev) == nullptr && gdk_device_get_product_id(dev) == nullptr)
++ // if (gdk_device_get_vendor_id(dev) == nullptr && gdk_device_get_product_id(dev) == nullptr)
++ if (gdk_device_get_device_type(dev) == GDK_DEVICE_TYPE_MASTER)
+ {
+ // Skip core pointer
+ devList = devList->next;
Home |
Main Index |
Thread Index |
Old Index