diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-10-12 12:37:18 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-10-12 12:37:18 +0000 |
| commit | 9248a27415b51ae5674dd79d1738cf8f0549806f (patch) | |
| tree | 7ee74806627058a1cc5c871805ccbb9779990e98 /src/splivarot.cpp | |
| parent | Fix rendering issue on panning with text tool (diff) | |
| download | inkscape-9248a27415b51ae5674dd79d1738cf8f0549806f.tar.gz inkscape-9248a27415b51ae5674dd79d1738cf8f0549806f.zip | |
Move from deprecated GTimeVal to g_get_monotonic_time()
Diffstat (limited to 'src/splivarot.cpp')
| -rw-r--r-- | src/splivarot.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 71920559b..1a61b4e3d 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -2261,7 +2261,7 @@ sp_selected_path_simplify_selection(SPDesktop *desktop, float threshold, bool ju // globals for keeping track of accelerated simplify -static double previousTime = 0.0; +static gint64 previous_time = 0; static gdouble simplifyMultiply = 1.0; void @@ -2273,13 +2273,9 @@ sp_selected_path_simplify(SPDesktop *desktop) bool simplifyJustCoalesce = prefs->getBool("/options/simplifyjustcoalesce/value", false); //Get the current time - GTimeVal currentTimeVal; - g_get_current_time(¤tTimeVal); - double currentTime = currentTimeVal.tv_sec * 1000000 + - currentTimeVal.tv_usec; - + gint64 current_time = g_get_monotonic_time(); //Was the previous call to this function recent? (<0.5 sec) - if (previousTime > 0.0 && currentTime - previousTime < 500000.0) { + if (previous_time > 0 && current_time - previous_time < 500000) { // add to the threshold 1/2 of its original value simplifyMultiply += 0.5; @@ -2291,7 +2287,7 @@ sp_selected_path_simplify(SPDesktop *desktop) } //remember time for next call - previousTime = currentTime; + previous_time = current_time; //g_print("%g\n", simplify_threshold); |
