Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Small fix to graphie-3d -- make sure a closed path is drawn #84085

Merged
merged 1 commit into from Oct 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions utils/graphie-3d.js
Expand Up @@ -211,7 +211,7 @@ $.extend(KhanUtil, {
face.drawBack = function() {
if (object.facesTransparent){
return graph.path(
face.mappedVerts(),
face.mappedVerts().concat(true),
{ fill: null, stroke: "#666", opacity: 0.1 }
);
}
Expand Down Expand Up @@ -267,7 +267,7 @@ $.extend(KhanUtil, {
// draw the sketch's lines
sketch.drawLines= function() {
return graph.path(
sketch.mappedVerts(),
sketch.mappedVerts().concat(true),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the problem.
For a sketch, mappedVerts() reports the verts on the visible side --- so don't need a closed path,
just to draw some lines.

In the context of face.drawBack the concat(true) makes sense to close the path.

My mistake --- I shouldn't have changed sketch.drawLines willy-nilly just because it looks like "the same thing."

{ fill: null, stroke: "#666", opacity: sketch.opacityValue }
);
};
Expand Down