1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

Finish line simplification support

This commit is contained in:
Starbeamrainbowlabs 2017-11-14 15:03:39 +00:00
parent d9ce6387a3
commit b35445fda9
4 changed files with 15 additions and 1193 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Nibriboard.RippleSpace;
using Nibriboard.Utilities;
using SBRL.Utilities;
namespace Nibriboard.Client
@ -84,10 +85,19 @@ namespace Nibriboard.Client
if(!currentLines.ContainsKey(lineId))
throw new KeyNotFoundException("Error: A line with that id wasn't found in this LineIncubator.");
Log.WriteLine("[LineIncubator] Completing line #{0}", lineId);
DrawnLine completedLine = currentLines[lineId];
currentLines.Remove(lineId);
DrawnLine completedLine = currentLines[lineId];
currentLines.Remove(lineId);
int originalPointCount = completedLine.Points.Count;
completedLine.Points = LineSimplifier.SimplifyLine(completedLine.Points, 6);
Log.WriteLine(
"[LineIncubator] [LineComplete] #{0}: {1} -> {2} points ({3:0.00}% reduction)",
lineId,
originalPointCount,
completedLine.Points.Count,
((float)completedLine.Points.Count / (float)originalPointCount) * 100f
);
return completedLine;
}

View file

@ -180,7 +180,7 @@ class Pencil
*/
recalculateSimplifiedLine()
{
this.currentSimplifiedLineSegments = simplify_line(this.currentLineSegments);
this.currentSimplifiedLineSegments = simplify_line(this.currentLineSegments, 6);
}
/**

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@ namespace Nibriboard.RippleSpace
/// </summary>
Addition,
/// <summary>
/// Something was deleted form the chunk.
/// Something was deleted from the chunk.
/// </summary>
Deletion,
/// <summary>