Remove carriage returns.

Also add a presubmit so they don't get added to source code.

Change-Id: I6a85c6a934b1068a63646a0dcc0d3a08baa96ced
Reviewed-on: https://skia-review.googlesource.com/57110
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2017-10-09 14:43:00 -04:00 committed by Skia Commit-Bot
parent cc6cc2963b
commit 29380bdd56
13 changed files with 1462 additions and 1459 deletions

View File

@ -222,6 +222,9 @@ def _CommonChecks(input_api, output_api):
results.extend(
_CheckChangeHasEol(
input_api, output_api, source_file_filter=sources))
results.extend(
input_api.canned_checks.CheckChangeHasNoCR(
input_api, output_api, source_file_filter=sources))
results.extend(_PythonChecks(input_api, output_api))
results.extend(_IfDefChecks(input_api, output_api))
results.extend(_CopyrightChecks(input_api, output_api,

View File

@ -1,17 +1,17 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>skia.png</file>
<file>delete.png</file>
<file>breakpoint_16x16.png</file>
<file>blank.png</file>
<file>breakpoint.png</file>
<file>inspector.png</file>
<file>reload.png</file>
<file>play.png</file>
<file>pause.png</file>
<file>rewind.png</file>
<file>previous.png</file>
<file>next.png</file>
<file>profile.png</file>
</qresource>
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>skia.png</file>
<file>delete.png</file>
<file>breakpoint_16x16.png</file>
<file>blank.png</file>
<file>breakpoint.png</file>
<file>inspector.png</file>
<file>reload.png</file>
<file>play.png</file>
<file>pause.png</file>
<file>rewind.png</file>
<file>previous.png</file>
<file>next.png</file>
<file>profile.png</file>
</qresource>
</RCC>

View File

@ -1 +1 @@
c:\Qt\4.8.3\bin\rcc.exe .qrc -o qrc_SkIcons.cpp -no-compress
c:\Qt\4.8.3\bin\rcc.exe .qrc -o qrc_SkIcons.cpp -no-compress

File diff suppressed because it is too large Load Diff

View File

@ -799,14 +799,14 @@ Returns height() times rowBytes if colorType is kUnknown_SkColorType.
}
}
#StdOut
width: 1 height: 1 computeByteSize: 4
width: 1 height: 1000 computeByteSize: 4999
width: 1 height: 1000000 computeByteSize: 4999999
width: 1000 height: 1 computeByteSize: 4000
width: 1000 height: 1000 computeByteSize: 4999000
width: 1000 height: 1000000 computeByteSize: 4999999000
width: 1000000 height: 1 computeByteSize: 4000000
width: 1000000 height: 1000 computeByteSize: 4999000000
width: 1 height: 1 computeByteSize: 4
width: 1 height: 1000 computeByteSize: 4999
width: 1 height: 1000000 computeByteSize: 4999999
width: 1000 height: 1 computeByteSize: 4000
width: 1000 height: 1000 computeByteSize: 4999000
width: 1000 height: 1000000 computeByteSize: 4999999000
width: 1000000 height: 1 computeByteSize: 4000000
width: 1000000 height: 1000 computeByteSize: 4999000000
width: 1000000 height: 1000000 computeByteSize: 4999999000000
##
##

View File

@ -1,143 +1,143 @@
#External
SkXXX
bmh_SkXXX
CL
Go
Visual_Studio
##
#Topic Bookmaker
How to use the Bookmaker utility.
Install
#A Go # https://golang.org/doc/install ##
if needed.
Get the fiddle command line interface tool.
By default this will appear in your home directory.
#Code
$ go get go.skia.org/infra/fiddle/go/fiddlecli
##
Build Bookmaker.
#Code
$ ninja -C out/dir bookmaker
##
Generate an starter Bookmaker file from an existing include.
#Code
$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs
##
If a method or function has an unnamed parameter, bookmaker generates an error:
#Code
###$
C:/puregit/include/core/SkPixmap.h(208): error: #Method missing param name
bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
^
$$$#
##
All parameters require names to allow markdown and doxygen documents to refer to
them. After naming all parameters, check in the include before continuing.
A successful run generates
#Code
docs/SkXXX_Reference.bmh
##
.
Next, use your favorite editor to fill out
#Code
docs/SkXXX_Reference.bmh
##
.
#Subtopic Style
Documentation consists of cross references, descriptions, and examples.
All structs, classes, enums, their members and methods, functions, and so on,
require descriptions. Most also require examples.
All methods and functions should include examples if practical.
Descriptions start with an active verb. Descriptions are complete, punctuated
sentences unless they describe parameters or return values. Parameters and
returned values are described by phrases that start lower case and do not
include trailing punctuation.
Descriptions are not self-referential; they do not include the thing they
describe. Descriptions may contain upper case references to definitions
but otherwise should be free of jargon.
Descriptions may contain code and formulas, each bracketed by markup.
Similar items may be grouped into topics. Topics may include subtopics.
Each document begins with one or more indices that include the contents of
that file. A class reference includes an index listing contained topics,
a separate listing for constructors, one for methods, and so on.
Class methods contain a description, any parameters, any return value,
an example, and any cross references.
Each method must contain either one or more examples or markup indicating
that there is no example.
##
Generate fiddle.json from all examples, including the ones you just wrote.
Error checking is syntatic: starting keywords are closed, keywords have the
correct parents.
If you run Bookmaker inside Visual_Studio, you can click on errors and it
will take you to the source line in question.
#Code
$ ./out/dir/bookmaker -e fiddle.json -b docs
##
Once complete, run fiddlecli to generate the example hashes.
Errors are contained by the output but aren't reported yet.
#Code
$ $GOPATH/bin/fiddlecli --input fiddle.json --output fiddleout.json
##
Generate bmh_SkXXX.md from SkXXX.bmh and fiddleout.json.
Error checking includes: undefined references, fiddle compiler errors,
missing or mismatched printf output.
Again, you can click on any errors inside Visual_Studio.
#Code
$ ./out/dir/bookmaker -r site/user/api -b docs -f fiddleout.json
##
The original include may have changed since you started creating the markdown.
Check to see if it is up to date.
This reports if a method no longer exists or its parameters have changed.
#Code
$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h
##
Generate an updated include header. Run:
#Code
$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h
##
to write the updated SkXXX.h to the current directory.
#Subtopic Bugs
Bookmaker bugs are tracked
#A here # bug.skia.org/6898 ##
.
##
#Topic Bookmaker ##
#External
SkXXX
bmh_SkXXX
CL
Go
Visual_Studio
##
#Topic Bookmaker
How to use the Bookmaker utility.
Install
#A Go # https://golang.org/doc/install ##
if needed.
Get the fiddle command line interface tool.
By default this will appear in your home directory.
#Code
$ go get go.skia.org/infra/fiddle/go/fiddlecli
##
Build Bookmaker.
#Code
$ ninja -C out/dir bookmaker
##
Generate an starter Bookmaker file from an existing include.
#Code
$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs
##
If a method or function has an unnamed parameter, bookmaker generates an error:
#Code
###$
C:/puregit/include/core/SkPixmap.h(208): error: #Method missing param name
bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
^
$$$#
##
All parameters require names to allow markdown and doxygen documents to refer to
them. After naming all parameters, check in the include before continuing.
A successful run generates
#Code
docs/SkXXX_Reference.bmh
##
.
Next, use your favorite editor to fill out
#Code
docs/SkXXX_Reference.bmh
##
.
#Subtopic Style
Documentation consists of cross references, descriptions, and examples.
All structs, classes, enums, their members and methods, functions, and so on,
require descriptions. Most also require examples.
All methods and functions should include examples if practical.
Descriptions start with an active verb. Descriptions are complete, punctuated
sentences unless they describe parameters or return values. Parameters and
returned values are described by phrases that start lower case and do not
include trailing punctuation.
Descriptions are not self-referential; they do not include the thing they
describe. Descriptions may contain upper case references to definitions
but otherwise should be free of jargon.
Descriptions may contain code and formulas, each bracketed by markup.
Similar items may be grouped into topics. Topics may include subtopics.
Each document begins with one or more indices that include the contents of
that file. A class reference includes an index listing contained topics,
a separate listing for constructors, one for methods, and so on.
Class methods contain a description, any parameters, any return value,
an example, and any cross references.
Each method must contain either one or more examples or markup indicating
that there is no example.
##
Generate fiddle.json from all examples, including the ones you just wrote.
Error checking is syntatic: starting keywords are closed, keywords have the
correct parents.
If you run Bookmaker inside Visual_Studio, you can click on errors and it
will take you to the source line in question.
#Code
$ ./out/dir/bookmaker -e fiddle.json -b docs
##
Once complete, run fiddlecli to generate the example hashes.
Errors are contained by the output but aren't reported yet.
#Code
$ $GOPATH/bin/fiddlecli --input fiddle.json --output fiddleout.json
##
Generate bmh_SkXXX.md from SkXXX.bmh and fiddleout.json.
Error checking includes: undefined references, fiddle compiler errors,
missing or mismatched printf output.
Again, you can click on any errors inside Visual_Studio.
#Code
$ ./out/dir/bookmaker -r site/user/api -b docs -f fiddleout.json
##
The original include may have changed since you started creating the markdown.
Check to see if it is up to date.
This reports if a method no longer exists or its parameters have changed.
#Code
$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h
##
Generate an updated include header. Run:
#Code
$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h
##
to write the updated SkXXX.h to the current directory.
#Subtopic Bugs
Bookmaker bugs are tracked
#A here # bug.skia.org/6898 ##
.
##
#Topic Bookmaker ##

View File

@ -422,27 +422,27 @@ DEF_SIMPLE_GM(bug5099, canvas, 50, 50) {
}
DEF_SIMPLE_GM(bug6083, canvas, 100, 50) {
SkPaint p;
p.setColor(SK_ColorRED);
p.setAntiAlias(true);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(15);
canvas->translate(-500, -130);
SkPath path;
path.moveTo(500.988f, 155.200f);
path.lineTo(526.109f, 155.200f);
SkPoint p1 = { 526.109f, 155.200f };
SkPoint p2 = { 525.968f, 212.968f };
SkPoint p3 = { 526.109f, 241.840f };
path.cubicTo(p1, p2, p3);
canvas->drawPath(path, p);
canvas->translate(50, 0);
path.reset();
p2.set(525.968f, 213.172f);
path.moveTo(500.988f, 155.200f);
path.lineTo(526.109f, 155.200f);
path.cubicTo(p1, p2, p3);
canvas->drawPath(path, p);
SkPaint p;
p.setColor(SK_ColorRED);
p.setAntiAlias(true);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(15);
canvas->translate(-500, -130);
SkPath path;
path.moveTo(500.988f, 155.200f);
path.lineTo(526.109f, 155.200f);
SkPoint p1 = { 526.109f, 155.200f };
SkPoint p2 = { 525.968f, 212.968f };
SkPoint p3 = { 526.109f, 241.840f };
path.cubicTo(p1, p2, p3);
canvas->drawPath(path, p);
canvas->translate(50, 0);
path.reset();
p2.set(525.968f, 213.172f);
path.moveTo(500.988f, 155.200f);
path.lineTo(526.109f, 155.200f);
path.cubicTo(p1, p2, p3);
canvas->drawPath(path, p);
}
//////////////////////////////////////////////////////////////////////////////

View File

@ -63,9 +63,9 @@ bool SkPathOpsDebug::ChaseContains(const SkTDArray<SkOpSpanBase* >& chaseArray,
return false;
}
#endif
#if DEBUG_ACTIVE_SPANS
SkString SkPathOpsDebug::gActiveSpans;
#if DEBUG_ACTIVE_SPANS
SkString SkPathOpsDebug::gActiveSpans;
#endif
#if DEBUG_COIN
@ -333,15 +333,15 @@ void SkPathOpsDebug::ShowActiveSpans(SkOpContourHead* contourList) {
do {
contour->debugShowActiveSpans(&str);
} while ((contour = contour->next()));
if (!gActiveSpans.equals(str)) {
const char* s = str.c_str();
const char* end;
while ((end = strchr(s, '\n'))) {
SkDebugf("%.*s", end - s + 1, s);
s = end + 1;
}
gActiveSpans.set(str);
}
if (!gActiveSpans.equals(str)) {
const char* s = str.c_str();
const char* end;
while ((end = strchr(s, '\n'))) {
SkDebugf("%.*s", end - s + 1, s);
s = end + 1;
}
gActiveSpans.set(str);
}
#endif
}

View File

@ -394,8 +394,8 @@ public:
static void VerifySimplify(const SkPath& path, const SkPath& result);
#endif
#if DEBUG_ACTIVE_SPANS
static SkString gActiveSpans;
#if DEBUG_ACTIVE_SPANS
static SkString gActiveSpans;
#endif
};

View File

@ -301,8 +301,8 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) {
SkDebugf("could not open output file %s\n", fullName.c_str());
return false;
}
size_t underscorePos = header.find('_');
if (string::npos != underscorePos) {
size_t underscorePos = header.find('_');
if (string::npos != underscorePos) {
header.replace(underscorePos, 1, " ");
}
SkASSERT(string::npos == header.find('_'));

View File

@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/open.png</file>
</qresource>
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/open.png</file>
</qresource>
</RCC>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
@ -7,14 +7,14 @@
<div style="height:0">
<div id="cubics">
{{{152, 16}, {152, 16.0685501}, {91.06044, 16.1242027}, {16, 16.1242027}}}, id=0
{{{16, 16.1242027}, {-59.06044, 16.1242027}, {-120, 16.0685501}, {-120, 16}}}, id=1
{{{-120, 16}, {-120, 15.9314508}, {-59.06044, 15.8757973}, {16, 15.8757973}}}, id=2
{{{16, 15.8757973}, {91.06044, 15.8757973}, {152, 15.9314508}, {152, 16}}}, id=3
{{{16, 16}, {152, 16}}}, id=4
{{{16, 17}, {152, 17}}}, id=5
{{{16, 16}, {16, 17}}}, id=6
{{{152, 16}, {152, 17}}}, id=7
{{{152, 16}, {152, 16.0685501}, {91.06044, 16.1242027}, {16, 16.1242027}}}, id=0
{{{16, 16.1242027}, {-59.06044, 16.1242027}, {-120, 16.0685501}, {-120, 16}}}, id=1
{{{-120, 16}, {-120, 15.9314508}, {-59.06044, 15.8757973}, {16, 15.8757973}}}, id=2
{{{16, 15.8757973}, {91.06044, 15.8757973}, {152, 15.9314508}, {152, 16}}}, id=3
{{{16, 16}, {152, 16}}}, id=4
{{{16, 17}, {152, 17}}}, id=5
{{{16, 16}, {16, 17}}}, id=6
{{{152, 16}, {152, 17}}}, id=7
</div>
</div>
@ -145,7 +145,7 @@
mouseX = (screenWidth / 2) / hscale + srcLeft;
mouseY = (screenHeight / 2) / vscale + srcTop;
hinitScale = hscale;
vinitScale = vscale;
vinitScale = vscale;
}
function setScale(x0, x1, y0, y1) {
@ -160,7 +160,7 @@
vscale = screenHeight / srcHeight;
if (uniformScale) {
hscale = Math.min(hscale, vscale);
vscale = hscale;
vscale = hscale;
}
var hinvScale = 1 / hscale;
var vinvScale = 1 / vscale;
@ -897,10 +897,10 @@ function dxy_at_t(curve, t) {
var scaleTextOffset = hscale != vscale ? -25 : -5;
ctx.fillText(hscale.toFixed(decimal_places) + 'x',
screenWidth - 10, screenHeight - scaleTextOffset);
if (hscale != vscale) {
if (hscale != vscale) {
ctx.fillText(vscale.toFixed(decimal_places) + 'y',
screenWidth - 10, screenHeight - 5);
}
screenWidth - 10, screenHeight - 5);
}
}
if (draw_t) {
drawPointAtT(curve);
@ -1105,10 +1105,10 @@ function dxy_at_t(curve, t) {
if (focusWasOn) {
focus_on_selection = false;
hscale /= 1.2;
vscale /= 1.2;
vscale /= 1.2;
} else {
hscale /= 2;
vscale /= 2;
hscale /= 2;
vscale /= 2;
}
calcLeftTop();
redraw();
@ -1119,11 +1119,11 @@ function dxy_at_t(curve, t) {
focusWasOn = focus_on_selection;
if (focusWasOn) {
focus_on_selection = false;
hscale *= 1.2;
vscale *= 1.2;
hscale *= 1.2;
vscale *= 1.2;
} else {
hscale *= 2;
vscale *= 2;
hscale *= 2;
vscale *= 2;
}
calcLeftTop();
redraw();

View File

@ -1,217 +1,217 @@
<html>
<head>
<div height="0" hidden="true">
Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ SK_DEBUG
<div id="android1">
seg=1 {{{-5, 0}, {1075, 0}}}
seg=2 {{{1075, 0}, {1075, 242}}}
seg=3 {{{1075, 242}, {-5, 242}}}
seg=4 {{{-5, 242}, {-5, 0}}}
op sect
seg=5 {{{0, 0}, {1080, 0}}}
seg=6 {{{1080, 0}, {1080, 242}}}
seg=7 {{{1080, 242}, {0, 242}}}
seg=8 {{{0, 242}, {0, 0}}}
debugShowLineIntersection wtTs[0]=0 {{{1075,0}, {1075,242}}} {{1075,0}} wnTs[0]=1 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=1 {{{-5,242}, {-5,0}}} {{-5,0}} wnTs[0]=0 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=0 {{{1075,242}, {-5,242}}} {{1075,242}} wnTs[0]=1 {{{1075,0}, {1075,242}}}
debugShowLineIntersection wtTs[0]=0 {{{-5,242}, {-5,0}}} {{-5,242}} wnTs[0]=1 {{{1075,242}, {-5,242}}}
debugShowLineIntersection wtTs[0]=0 {{{0,0}, {1080,0}}} {{0,0}} wtTs[1]=0.99537037 {{1075,0}} wnTs[0]=0.00462963 {{{-5,0}, {1075,0}}} wnTs[1]=1
SkOpSegment::addT insert t=0.00462962963 segID=1 spanID=17
SkOpSegment::addT insert t=0.99537037 segID=5 spanID=18
debugShowLineIntersection wtTs[0]=1 {{{0,242}, {0,0}}} {{0,0}} wnTs[0]=0.00462963 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=0.99537037 {{{0,0}, {1080,0}}} {{1075,0}} wnTs[0]=0 {{{1075,0}, {1075,242}}}
debugShowLineIntersection wtTs[0]=0.00462962963 {{{1080,242}, {0,242}}} {{1075,242}} wnTs[0]=1 {{{1075,0}, {1075,242}}}
SkOpSegment::addT insert t=0.00462962963 segID=7 spanID=19
debugShowLineIntersection wtTs[0]=0.00462962963 {{{1080,242}, {0,242}}} {{1075,242}} wtTs[1]=1 {{0,242}} wnTs[0]=0 {{{1075,242}, {-5,242}}} wnTs[1]=0.99537037
SkOpSegment::addT insert t=0.99537037 segID=3 spanID=20
debugShowLineIntersection wtTs[0]=0 {{{0,242}, {0,0}}} {{0,242}} wnTs[0]=0.99537 {{{1075,242}, {-5,242}}}
debugShowLineIntersection wtTs[0]=0 {{{1080,0}, {1080,242}}} {{1080,0}} wnTs[0]=1 {{{0,0}, {1080,0}}}
debugShowLineIntersection wtTs[0]=1 {{{0,242}, {0,0}}} {{0,0}} wnTs[0]=0 {{{0,0}, {1080,0}}}
debugShowLineIntersection wtTs[0]=0 {{{1080,242}, {0,242}}} {{1080,242}} wnTs[0]=1 {{{1080,0}, {1080,242}}}
debugShowLineIntersection wtTs[0]=0 {{{0,242}, {0,0}}} {{0,242}} wnTs[0]=1 {{{1080,242}, {0,242}}}
------------------x--x---------------- addExpanded
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
SkOpSegment::debugShowActiveSpans id=1 (-5,0 -8.8817842e-16,0) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (2.22044605e-14,242 -5,242) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=4 (-5,242 -5,0) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (0,0 1075,0) t=0 tEnd=0.99537037 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1075,242 0,242) t=0.00462962963 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=? windValue=1
------------------x--x---------------- move_multiples
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- move_nearby
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- correctEnds
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- addEndMovedSpans
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- expand
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- addExpanded
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- mark
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
-------------------------------------- missing_coincidence
-------------------------------------- expand
-------------------------------------- expand
-------------------------------------- apply
SkOpSegment::markDone id=7 (1080,242 0,242) t=0.00462962963 [19] (1075,242) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
SkOpSegment::markDone id=5 (0,0 1080,0) t=0 [9] (0,0) tEnd=0.99537037 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
-------------------------------------- findOverlaps
SkOpSegment::debugShowActiveSpans id=1 (-5,0 -8.8817842e-16,0) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=3 (2.22044605e-14,242 -5,242) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=4 (-5,242 -5,0) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=? windValue=1
-------------------------------------- calc_angles
SkOpSegment::sortAngles [1] tStart=0.00462962963 [17]
SkOpAngle::after [1/1] 15/15 tStart=0.00462962963 tEnd=0 < [8/12] 23/23 tStart=1 tEnd=0 < [1/2] 31/31 tStart=0.00462962963 tEnd=1 T 4
SkOpAngle::afterPart {{{0,0}, {-5,0}}} id=1
SkOpAngle::afterPart {{{0,0}, {0,242}}} id=8
SkOpAngle::afterPart {{{0,0}, {1075,0}}} id=1
SkOpSegment::sortAngles [1] tStart=1 [2]
SkOpAngle::after [1/3] 15/15 tStart=1 tEnd=0.00462962963 < [2/4] 23/23 tStart=0 tEnd=1 < [5/9] 31/31 tStart=0.99537037 tEnd=1 T 4
SkOpAngle::afterPart {{{1075,0}, {-8.8817842e-16,0}}} id=1
SkOpAngle::afterPart {{{1075,0}, {1075,242}}} id=2
SkOpAngle::afterPart {{{1075,0}, {1080,0}}} id=5
SkOpSegment::sortAngles [2] tStart=0 [3]
SkOpSegment::sortAngles [2] tStart=1 [4]
SkOpAngle::after [2/5] 7/7 tStart=1 tEnd=0 < [3/6] 15/15 tStart=0 tEnd=0.99537037 < [7/10] 31/31 tStart=0.00462962963 tEnd=0 T 4
SkOpAngle::afterPart {{{1075,242}, {1075,0}}} id=2
SkOpAngle::afterPart {{{1075,242}, {2.22044605e-14,242}}} id=3
SkOpAngle::afterPart {{{1075,242}, {1080,242}}} id=7
SkOpSegment::sortAngles [3] tStart=0 [5]
SkOpSegment::sortAngles [3] tStart=0.99537037 [20]
SkOpAngle::after [3/7] 31/31 tStart=0.99537037 tEnd=0 < [8/11] 7/7 tStart=0 tEnd=1 < [3/8] 15/15 tStart=0.99537037 tEnd=1 T 4
SkOpAngle::afterPart {{{0,242}, {1075,242}}} id=3
SkOpAngle::afterPart {{{0,242}, {0,0}}} id=8
SkOpAngle::afterPart {{{0,242}, {-5,242}}} id=3
SkOpSegment::sortAngles [5] tStart=0.99537037 [18]
SkOpSegment::sortAngles [7] tStart=0.00462962963 [19]
SkOpSegment::sortAngles [8] tStart=0 [15]
SkOpSegment::sortAngles [8] tStart=1 [16]
coinSpan - id=3 t=0 tEnd=0.99537037
coinSpan + id=7 t=0.00462962963 tEnd=1
coinSpan - id=1 t=0.00462962963 tEnd=1
coinSpan + id=5 t=0 tEnd=0.99537037
SkOpSpan::sortableTop dir=kTop seg=1 t=0.00231481481 pt=(-2.5,0)
SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=1 seg=1 {{{-5, 0}, {1075, 0}}} t=0.00231481481 pt=(-2.5,0) slope=(1080,0)
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=4 (-5,242 -5,0) t=0 [7] (-5,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=3 (1075,242 -5,242) t=0.99537037 [20] (2.22044605e-14,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::activeOp id=1 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
SkOpSegment::markDone id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=4 (-5,242 -5,0) t=0 [7] (-5,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=3 (1075,242 -5,242) t=0.99537037 [20] (2.22044605e-14,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
bridgeOp chase.append id=3 windSum=-1
SkOpSegment::markWinding id=3 (1075,242 -5,242) t=0 [5] (1075,242) tEnd=0.99537037 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
SkOpSegment::markAngle last segment=3 span=5 windSum=-1
SkOpSegment::markWinding id=8 (0,242 0,0) t=0 [15] (0,242) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=8 span=16
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=-1 oppSum=-1 windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=-1 oppSum=-1 windValue=1 oppValue=0
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markWinding id=7 (1080,242 0,242) t=0 [13] (1080,242) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=6 (1080,0 1080,242) t=0 [11] (1080,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=5 (0,0 1080,0) t=0.99537037 [18] (1075,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=5 span=18 windSum=-1
SkOpSegment::markWinding id=2 (1075,0 1075,242) t=0 [3] (1075,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=2 span=3 windSum=-1
SkOpSegment::findNextOp
SkOpAngle::dumpOne [3/6] next=7/10 sect=15/15 s=0 [5] e=0.99537037 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpAngle::dumpOne [7/10] next=2/5 sect=31/31 s=0.00462962963 [19] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [2/5] next=3/6 sect=7/7 s=1 [4] e=0 [3] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpSegment::activeOp id=7 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=0 suFrom=0 suTo=1 result=0
SkOpSegment::markDone id=7 (1080,242 0,242) t=0 [13] (1080,242) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=6 (1080,0 1080,242) t=0 [11] (1080,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=5 (0,0 1080,0) t=0.99537037 [18] (1075,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp chase.append segment=5 span=18 windSum=-1
SkOpSegment::activeOp id=2 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=1 suTo=1 result=1
SkOpSegment::findNextOp chase.append segment=2 span=3 windSum=-1
SkOpSegment::markDone id=3 (1075,242 -5,242) t=0 [5] (1075,242) tEnd=0.99537037 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
SkOpSegment::findNextOp from:[3] to:[2] start=90366152 end=90366008
bridgeOp current id=3 from=(2.22044605e-14,242) to=(1075,242)
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0.00462962963 [17] (-8.8817842e-16,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
SkOpSegment::markAngle last segment=1 span=17 windSum=-1
SkOpSegment::findNextOp
SkOpAngle::dumpOne [2/4] next=5/9 sect=23/23 s=0 [3] e=1 [4] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpAngle::dumpOne [5/9] next=1/3 sect=31/31 s=0.99537037 [18] e=1 [10] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done operand
SkOpAngle::dumpOne [1/3] next=2/4 sect=15/15 s=1 [2] e=0.00462962963 [17] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpSegment::activeOp id=5 t=0.99537037 tEnd=1 op=sect miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
SkOpSegment::activeOp id=1 t=1 tEnd=0.00462962963 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::findNextOp chase.append segment=1 span=17 windSum=-1
SkOpSegment::markDone id=2 (1075,0 1075,242) t=0 [3] (1075,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[2] to:[1] start=90365736 end=90368360
bridgeOp current id=2 from=(1075,242) to=(1075,0)
path.moveTo(2.22044605e-14,242);
path.lineTo(1075,242);
SkOpSegment::findNextOp
SkOpAngle::dumpOne [1/2] next=1/1 sect=31/31 s=0.00462962963 [17] e=1 [2] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpAngle::dumpOne [1/1] next=8/12 sect=15/15 s=0.00462962963 [17] e=0 [1] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
SkOpAngle::dumpOne [8/12] next=1/2 sect=23/23 s=1 [16] e=0 [15] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1 operand
SkOpSegment::activeOp id=1 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
SkOpSegment::activeOp id=8 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markDone id=1 (-5,0 1075,0) t=0.00462962963 [17] (-8.8817842e-16,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
SkOpSegment::findNextOp from:[1] to:[8] start=90368192 end=90368048
bridgeOp current id=1 from=(1075,0) to=(-8.8817842e-16,0)
path.lineTo(1075,0);
SkOpSegment::findNextOp
SkOpAngle::dumpOne [8/11] next=3/8 sect=7/7 s=0 [15] e=1 [16] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=-1 operand
SkOpAngle::dumpOne [3/8] next=3/7 sect=15/15 s=0.99537037 [20] e=1 [6] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
SkOpAngle::dumpOne [3/7] next=8/11 sect=31/31 s=0.99537037 [20] e=0 [5] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 done
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=1 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markDone id=8 (0,242 0,0) t=0 [15] (0,242) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[8] to:[3] start=90368840 end=90366336
bridgeOp current id=8 from=(0,0) to=(0,242)
path.lineTo(-8.8817842e-16,0);
path.lineTo(0,242);
path.close();
</div>
Skia UnitTests: --match PathOpsOp$ --resourcePath resources\ SK_DEBUG
<div id="android1">
seg=1 {{{-5, 0}, {1075, 0}}}
seg=2 {{{1075, 0}, {1075, 242}}}
seg=3 {{{1075, 242}, {-5, 242}}}
seg=4 {{{-5, 242}, {-5, 0}}}
op sect
seg=5 {{{0, 0}, {1080, 0}}}
seg=6 {{{1080, 0}, {1080, 242}}}
seg=7 {{{1080, 242}, {0, 242}}}
seg=8 {{{0, 242}, {0, 0}}}
debugShowLineIntersection wtTs[0]=0 {{{1075,0}, {1075,242}}} {{1075,0}} wnTs[0]=1 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=1 {{{-5,242}, {-5,0}}} {{-5,0}} wnTs[0]=0 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=0 {{{1075,242}, {-5,242}}} {{1075,242}} wnTs[0]=1 {{{1075,0}, {1075,242}}}
debugShowLineIntersection wtTs[0]=0 {{{-5,242}, {-5,0}}} {{-5,242}} wnTs[0]=1 {{{1075,242}, {-5,242}}}
debugShowLineIntersection wtTs[0]=0 {{{0,0}, {1080,0}}} {{0,0}} wtTs[1]=0.99537037 {{1075,0}} wnTs[0]=0.00462963 {{{-5,0}, {1075,0}}} wnTs[1]=1
SkOpSegment::addT insert t=0.00462962963 segID=1 spanID=17
SkOpSegment::addT insert t=0.99537037 segID=5 spanID=18
debugShowLineIntersection wtTs[0]=1 {{{0,242}, {0,0}}} {{0,0}} wnTs[0]=0.00462963 {{{-5,0}, {1075,0}}}
debugShowLineIntersection wtTs[0]=0.99537037 {{{0,0}, {1080,0}}} {{1075,0}} wnTs[0]=0 {{{1075,0}, {1075,242}}}
debugShowLineIntersection wtTs[0]=0.00462962963 {{{1080,242}, {0,242}}} {{1075,242}} wnTs[0]=1 {{{1075,0}, {1075,242}}}
SkOpSegment::addT insert t=0.00462962963 segID=7 spanID=19
debugShowLineIntersection wtTs[0]=0.00462962963 {{{1080,242}, {0,242}}} {{1075,242}} wtTs[1]=1 {{0,242}} wnTs[0]=0 {{{1075,242}, {-5,242}}} wnTs[1]=0.99537037
SkOpSegment::addT insert t=0.99537037 segID=3 spanID=20
debugShowLineIntersection wtTs[0]=0 {{{0,242}, {0,0}}} {{0,242}} wnTs[0]=0.99537 {{{1075,242}, {-5,242}}}
debugShowLineIntersection wtTs[0]=0 {{{1080,0}, {1080,242}}} {{1080,0}} wnTs[0]=1 {{{0,0}, {1080,0}}}
debugShowLineIntersection wtTs[0]=1 {{{0,242}, {0,0}}} {{0,0}} wnTs[0]=0 {{{0,0}, {1080,0}}}
debugShowLineIntersection wtTs[0]=0 {{{1080,242}, {0,242}}} {{1080,242}} wnTs[0]=1 {{{1080,0}, {1080,242}}}
debugShowLineIntersection wtTs[0]=0 {{{0,242}, {0,0}}} {{0,242}} wnTs[0]=1 {{{1080,242}, {0,242}}}
------------------x--x---------------- addExpanded
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
SkOpSegment::debugShowActiveSpans id=1 (-5,0 -8.8817842e-16,0) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (2.22044605e-14,242 -5,242) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=4 (-5,242 -5,0) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (0,0 1075,0) t=0 tEnd=0.99537037 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1075,242 0,242) t=0.00462962963 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=? windValue=1
------------------x--x---------------- move_multiples
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- move_nearby
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- correctEnds
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- addEndMovedSpans
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- expand
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- addExpanded
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
------------------x--x---------------- mark
00: seg/base=3/5 seg/base=7/19 MarkCoinStart
01: seg/base=3/20 seg/base=7/14 MarkCoinEnd
02: seg/base=1/17 seg/base=5/9 MarkCoinStart
03: seg/base=1/2 seg/base=5/18 MarkCoinEnd
-------------------------------------- missing_coincidence
-------------------------------------- expand
-------------------------------------- expand
-------------------------------------- apply
SkOpSegment::markDone id=7 (1080,242 0,242) t=0.00462962963 [19] (1075,242) tEnd=1 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
SkOpSegment::markDone id=5 (0,0 1080,0) t=0 [9] (0,0) tEnd=0.99537037 newWindSum=? newOppSum=? oppSum=? windSum=? windValue=0 oppValue=0
-------------------------------------- findOverlaps
SkOpSegment::debugShowActiveSpans id=1 (-5,0 -8.8817842e-16,0) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=3 (2.22044605e-14,242 -5,242) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=4 (-5,242 -5,0) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=? windValue=1
-------------------------------------- calc_angles
SkOpSegment::sortAngles [1] tStart=0.00462962963 [17]
SkOpAngle::after [1/1] 15/15 tStart=0.00462962963 tEnd=0 < [8/12] 23/23 tStart=1 tEnd=0 < [1/2] 31/31 tStart=0.00462962963 tEnd=1 T 4
SkOpAngle::afterPart {{{0,0}, {-5,0}}} id=1
SkOpAngle::afterPart {{{0,0}, {0,242}}} id=8
SkOpAngle::afterPart {{{0,0}, {1075,0}}} id=1
SkOpSegment::sortAngles [1] tStart=1 [2]
SkOpAngle::after [1/3] 15/15 tStart=1 tEnd=0.00462962963 < [2/4] 23/23 tStart=0 tEnd=1 < [5/9] 31/31 tStart=0.99537037 tEnd=1 T 4
SkOpAngle::afterPart {{{1075,0}, {-8.8817842e-16,0}}} id=1
SkOpAngle::afterPart {{{1075,0}, {1075,242}}} id=2
SkOpAngle::afterPart {{{1075,0}, {1080,0}}} id=5
SkOpSegment::sortAngles [2] tStart=0 [3]
SkOpSegment::sortAngles [2] tStart=1 [4]
SkOpAngle::after [2/5] 7/7 tStart=1 tEnd=0 < [3/6] 15/15 tStart=0 tEnd=0.99537037 < [7/10] 31/31 tStart=0.00462962963 tEnd=0 T 4
SkOpAngle::afterPart {{{1075,242}, {1075,0}}} id=2
SkOpAngle::afterPart {{{1075,242}, {2.22044605e-14,242}}} id=3
SkOpAngle::afterPart {{{1075,242}, {1080,242}}} id=7
SkOpSegment::sortAngles [3] tStart=0 [5]
SkOpSegment::sortAngles [3] tStart=0.99537037 [20]
SkOpAngle::after [3/7] 31/31 tStart=0.99537037 tEnd=0 < [8/11] 7/7 tStart=0 tEnd=1 < [3/8] 15/15 tStart=0.99537037 tEnd=1 T 4
SkOpAngle::afterPart {{{0,242}, {1075,242}}} id=3
SkOpAngle::afterPart {{{0,242}, {0,0}}} id=8
SkOpAngle::afterPart {{{0,242}, {-5,242}}} id=3
SkOpSegment::sortAngles [5] tStart=0.99537037 [18]
SkOpSegment::sortAngles [7] tStart=0.00462962963 [19]
SkOpSegment::sortAngles [8] tStart=0 [15]
SkOpSegment::sortAngles [8] tStart=1 [16]
coinSpan - id=3 t=0 tEnd=0.99537037
coinSpan + id=7 t=0.00462962963 tEnd=1
coinSpan - id=1 t=0.00462962963 tEnd=1
coinSpan + id=5 t=0 tEnd=0.99537037
SkOpSpan::sortableTop dir=kTop seg=1 t=0.00231481481 pt=(-2.5,0)
SkOpSpan::sortableTop [0] valid=1 operand=0 span=1 ccw=1 seg=1 {{{-5, 0}, {1075, 0}}} t=0.00231481481 pt=(-2.5,0) slope=(1080,0)
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=4 (-5,242 -5,0) t=0 [7] (-5,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=3 (1075,242 -5,242) t=0.99537037 [20] (2.22044605e-14,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::activeOp id=1 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
SkOpSegment::markDone id=1 (-5,0 1075,0) t=0 [1] (-5,0) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=4 (-5,242 -5,0) t=0 [7] (-5,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=3 (1075,242 -5,242) t=0.99537037 [20] (2.22044605e-14,242) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
bridgeOp chase.append id=3 windSum=-1
SkOpSegment::markWinding id=3 (1075,242 -5,242) t=0 [5] (1075,242) tEnd=0.99537037 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
SkOpSegment::markAngle last segment=3 span=5 windSum=-1
SkOpSegment::markWinding id=8 (0,242 0,0) t=0 [15] (0,242) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=8 span=16
SkOpSegment::debugShowActiveSpans id=1 (-8.8817842e-16,0 1075,0) t=0.00462962963 tEnd=1 windSum=? oppSum=? windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=2 (1075,0 1075,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (1075,242 2.22044605e-14,242) t=0 tEnd=0.99537037 windSum=-1 oppSum=-1 windValue=1 oppValue=1
SkOpSegment::debugShowActiveSpans id=5 (1075,0 1080,0) t=0.99537037 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (1080,0 1080,242) t=0 tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (1080,242 1075,242) t=0 tEnd=0.00462962963 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (0,242 0,0) t=0 tEnd=1 windSum=-1 oppSum=-1 windValue=1 oppValue=0
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markWinding id=7 (1080,242 0,242) t=0 [13] (1080,242) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=6 (1080,0 1080,242) t=0 [11] (1080,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=5 (0,0 1080,0) t=0.99537037 [18] (1075,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=5 span=18 windSum=-1
SkOpSegment::markWinding id=2 (1075,0 1075,242) t=0 [3] (1075,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=2 span=3 windSum=-1
SkOpSegment::findNextOp
SkOpAngle::dumpOne [3/6] next=7/10 sect=15/15 s=0 [5] e=0.99537037 [20] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpAngle::dumpOne [7/10] next=2/5 sect=31/31 s=0.00462962963 [19] e=0 [13] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [2/5] next=3/6 sect=7/7 s=1 [4] e=0 [3] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpSegment::activeOp id=7 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=0 suFrom=0 suTo=1 result=0
SkOpSegment::markDone id=7 (1080,242 0,242) t=0 [13] (1080,242) tEnd=0.00462962963 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=6 (1080,0 1080,242) t=0 [11] (1080,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=5 (0,0 1080,0) t=0.99537037 [18] (1075,0) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp chase.append segment=5 span=18 windSum=-1
SkOpSegment::activeOp id=2 t=1 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=1 suTo=1 result=1
SkOpSegment::findNextOp chase.append segment=2 span=3 windSum=-1
SkOpSegment::markDone id=3 (1075,242 -5,242) t=0 [5] (1075,242) tEnd=0.99537037 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
SkOpSegment::findNextOp from:[3] to:[2] start=90366152 end=90366008
bridgeOp current id=3 from=(2.22044605e-14,242) to=(1075,242)
SkOpSegment::markWinding id=1 (-5,0 1075,0) t=0.00462962963 [17] (-8.8817842e-16,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=1
SkOpSegment::markAngle last segment=1 span=17 windSum=-1
SkOpSegment::findNextOp
SkOpAngle::dumpOne [2/4] next=5/9 sect=23/23 s=0 [3] e=1 [4] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpAngle::dumpOne [5/9] next=1/3 sect=31/31 s=0.99537037 [18] e=1 [10] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done operand
SkOpAngle::dumpOne [1/3] next=2/4 sect=15/15 s=1 [2] e=0.00462962963 [17] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpSegment::activeOp id=5 t=0.99537037 tEnd=1 op=sect miFrom=0 miTo=0 suFrom=1 suTo=0 result=0
SkOpSegment::activeOp id=1 t=1 tEnd=0.00462962963 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::findNextOp chase.append segment=1 span=17 windSum=-1
SkOpSegment::markDone id=2 (1075,0 1075,242) t=0 [3] (1075,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[2] to:[1] start=90365736 end=90368360
bridgeOp current id=2 from=(1075,242) to=(1075,0)
path.moveTo(2.22044605e-14,242);
path.lineTo(1075,242);
SkOpSegment::findNextOp
SkOpAngle::dumpOne [1/2] next=1/1 sect=31/31 s=0.00462962963 [17] e=1 [2] sgn=-1 windVal=1 windSum=-1 oppVal=1 oppSum=-1
SkOpAngle::dumpOne [1/1] next=8/12 sect=15/15 s=0.00462962963 [17] e=0 [1] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
SkOpAngle::dumpOne [8/12] next=1/2 sect=23/23 s=1 [16] e=0 [15] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1 operand
SkOpSegment::activeOp id=1 t=0.00462962963 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=0 result=0
SkOpSegment::activeOp id=8 t=1 tEnd=0 op=sect miFrom=1 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markDone id=1 (-5,0 1075,0) t=0.00462962963 [17] (-8.8817842e-16,0) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=1
SkOpSegment::findNextOp from:[1] to:[8] start=90368192 end=90368048
bridgeOp current id=1 from=(1075,0) to=(-8.8817842e-16,0)
path.lineTo(1075,0);
SkOpSegment::findNextOp
SkOpAngle::dumpOne [8/11] next=3/8 sect=7/7 s=0 [15] e=1 [16] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=-1 operand
SkOpAngle::dumpOne [3/8] next=3/7 sect=15/15 s=0.99537037 [20] e=1 [6] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
SkOpAngle::dumpOne [3/7] next=8/11 sect=31/31 s=0.99537037 [20] e=0 [5] sgn=1 windVal=1 windSum=-1 oppVal=1 oppSum=-1 done
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=1 op=sect miFrom=1 miTo=0 suFrom=0 suTo=0 result=0
SkOpSegment::activeOp id=3 t=0.99537037 tEnd=0 op=sect miFrom=0 miTo=1 suFrom=0 suTo=1 result=1
SkOpSegment::markDone id=8 (0,242 0,0) t=0 [15] (0,242) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[8] to:[3] start=90368840 end=90366336
bridgeOp current id=8 from=(0,0) to=(0,242)
path.lineTo(-8.8817842e-16,0);
path.lineTo(0,242);
path.close();
</div>
</div>
<script type="text/javascript">
@ -2226,9 +2226,9 @@ function dxy_at_t(curve, type, t) {
return dxy;
}
function dpt_at_t(curve, t) {
function dpt_at_t(curve, t) {
var type = PATH_LINE + (curve.length / 2 - 2);
return dxy_at_t(curve, type, t);
return dxy_at_t(curve, type, t);
}
function drawLabel(num, px, py) {
@ -2346,11 +2346,11 @@ function y_at_t(curve, t) {
return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
}
function pt_at_t(curve, t) {
var pt = {};
pt.x = x_at_t(curve, t);
pt.y = y_at_t(curve, t);
return pt;
function pt_at_t(curve, t) {
var pt = {};
pt.x = x_at_t(curve, t);
pt.y = y_at_t(curve, t);
return pt;
}
function drawOrder(curve, t, label) {
@ -2377,59 +2377,59 @@ function drawOrder(curve, t, label) {
ctx.font = "normal 10px Arial";
}
function drawVisibleOrder(curve, label) {
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
var defaultT = 0.85;
if (sOn && eOn)
return drawOrder(curve, defaultT, label);
if (sOn || eOn) {
if (eOn) {
defaultT = 1 - defaultT;
}
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawOrder(curve, t, label);
t += step;
step /= 2;
} while (--tries > 0);
drawOrder(curve, defaultT, label);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom + 0.1;
if (t >= 1) {
break;
}
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawOrder(curve, t, label);
}
denom *= 2;
} while (--tries > 0);
drawOrder(curve, defaultT, label);
function drawVisibleOrder(curve, label) {
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
var defaultT = 0.85;
if (sOn && eOn)
return drawOrder(curve, defaultT, label);
if (sOn || eOn) {
if (eOn) {
defaultT = 1 - defaultT;
}
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawOrder(curve, t, label);
t += step;
step /= 2;
} while (--tries > 0);
drawOrder(curve, defaultT, label);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom + 0.1;
if (t >= 1) {
break;
}
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawOrder(curve, t, label);
}
denom *= 2;
} while (--tries > 0);
drawOrder(curve, defaultT, label);
}
function set_length(pt, newLen) {
var len = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
var scale = newLen / len;
var newPt = { x: pt.x * scale, y: pt.y * scale };
return newPt;
function set_length(pt, newLen) {
var len = Math.sqrt(pt.x * pt.x + pt.y * pt.y);
var scale = newLen / len;
var newPt = { x: pt.x * scale, y: pt.y * scale };
return newPt;
}
function drawDirection(curve, t) {
function drawDirection(curve, t) {
var d = dpt_at_t(curve, t);
d = set_length(d, 16);
var pt = localToGlobal(pt_at_t(curve, t));
var pt = localToGlobal(pt_at_t(curve, t));
ctx.beginPath();
ctx.moveTo(pt.x - d.y, pt.y + d.x);
ctx.lineTo(pt.x + d.x, pt.y + d.y);
@ -2438,47 +2438,47 @@ function drawDirection(curve, t) {
ctx.stroke();
}
function drawVisibleDirection(curve) {
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
var defaultT = 0.65;
if (sOn && eOn) {
return drawDirection(curve, defaultT);
}
if (sOn || eOn) {
if (eOn) {
defaultT = 1 - defaultT;
}
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawDirection(curve, t);
t += step;
step /= 2;
} while (--tries > 0);
drawDirection(curve, defaultT);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom + 0.1;
if (t >= 1) {
break;
}
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawDirection(curve, t);
}
denom *= 2;
} while (--tries > 0);
drawDirection(curve, defaultT);
function drawVisibleDirection(curve) {
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
var defaultT = 0.65;
if (sOn && eOn) {
return drawDirection(curve, defaultT);
}
if (sOn || eOn) {
if (eOn) {
defaultT = 1 - defaultT;
}
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawDirection(curve, t);
t += step;
step /= 2;
} while (--tries > 0);
drawDirection(curve, defaultT);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom + 0.1;
if (t >= 1) {
break;
}
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawDirection(curve, t);
}
denom *= 2;
} while (--tries > 0);
drawDirection(curve, defaultT);
}
function drawID(curve, t, id) {
@ -2489,53 +2489,53 @@ function drawID(curve, t, id) {
draw_id_at(id, _px, _py);
}
function localToGlobal(local) {
var global = {};
global.x = (local.x - srcLeft) * scale;
global.y = (local.y - srcTop) * scale;
return global;
function localToGlobal(local) {
var global = {};
global.x = (local.x - srcLeft) * scale;
global.y = (local.y - srcTop) * scale;
return global;
}
function ptOnScreen(local) {
var pt = localToGlobal(local);
return 10 <= pt.x && pt.x <= screenWidth - 10
&& 10 <= pt.y && pt.y <= screenHeight - 10;
function ptOnScreen(local) {
var pt = localToGlobal(local);
return 10 <= pt.x && pt.x <= screenWidth - 10
&& 10 <= pt.y && pt.y <= screenHeight - 10;
}
function drawVisibleID(curve, defaultT, id) {
// determine if either or both ends are visible
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
if (sOn && eOn)
return drawID(curve, defaultT, id);
if (sOn || eOn) {
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawID(curve, t, id);
t += step;
step /= 2;
} while (--tries > 0);
drawID(curve, defaultT, id);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom;
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawID(curve, t, id);
}
denom *= 2;
} while (--tries > 0);
drawID(curve, defaultT, id);
function drawVisibleID(curve, defaultT, id) {
// determine if either or both ends are visible
var s = pt_at_t(curve, 0);
var e = pt_at_t(curve, 1);
var sOn = ptOnScreen(s);
var eOn = ptOnScreen(e);
if (sOn && eOn)
return drawID(curve, defaultT, id);
if (sOn || eOn) {
var step = sOn ? -defaultT / 2 : (1 - defaultT) / 2;
var t = defaultT;
var tries = 16;
do {
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawID(curve, t, id);
t += step;
step /= 2;
} while (--tries > 0);
drawID(curve, defaultT, id);
}
// scattershot until we find a visible point
var denom = 2; // visit odd number num / denom to hit unique pts
var tries = 6; // tries 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16 ...
do {
for (var numer = 1; numer < denom; numer += 2) {
var t = numer / denom;
var mid = pt_at_t(curve, t);
if (ptOnScreen(mid))
return drawID(curve, t, id);
}
denom *= 2;
} while (--tries > 0);
drawID(curve, defaultT, id);
}
function draw_id_at(id, _px, _py) {
@ -2613,8 +2613,8 @@ function drawCurveSpecials(test, curve, type) {
drawVisibleID(curve, 0.5, id);
}
}
if (draw_direction) {
drawVisibleDirection(curve);
if (draw_direction) {
drawVisibleDirection(curve);
}
if (type == PATH_LINE) {
return;
@ -3205,10 +3205,10 @@ function draw(test, lines, title) {
drawVisibleOrder(leftCurve, 'L');
drawVisibleOrder(rightCurve, 'R');
}
if (draw_id) {
drawVisibleID(leftCurve, 0.5, frags[0]);
drawVisibleID(midCurve, 0.5, frags[6]);
drawVisibleID(rightCurve, 0.5, frags[12]);
if (draw_id) {
drawVisibleID(leftCurve, 0.5, frags[0]);
drawVisibleID(midCurve, 0.5, frags[6]);
drawVisibleID(rightCurve, 0.5, frags[12]);
}
break;
case REC_TYPE_AFTERPART:
@ -3245,8 +3245,8 @@ function draw(test, lines, title) {
throw "stop execution";
}
drawCurve(curve);
if (draw_id) {
drawVisibleID(curve, 0.5, id);
if (draw_id) {
drawVisibleID(curve, 0.5, id);
}
++afterIndex;
break;