Skip to content

twistmarks for start- and endtwists with colorcode element#286

Open
MAETempels wants to merge 17 commits into
d-bl:masterfrom
MAETempels:master
Open

twistmarks for start- and endtwists with colorcode element#286
MAETempels wants to merge 17 commits into
d-bl:masterfrom
MAETempels:master

Conversation

@MAETempels

Copy link
Copy Markdown
Collaborator

Fixes issue #285 .

Description / purpose of the changes

The standard colorcode-element is defined as stitches starting and ending with "C".
The randomlist generates stitches that can start and end with twists.
For clearity, we have added these twistmarks to the colorcode-element.

Notify

@d-bl/gf

Comment thread docs/js/stitch-gallery.js Outdated
southEast = ((displayStitch.substring(displayStitch.lastIndexOf("C")+1)).replaceAll("L","")).length.toString();
southWest = ((displayStitch.substring(displayStitch.lastIndexOf("C")+1)).replaceAll("R","")).length.toString();
northEast = ((displayStitch.substring(0, displayStitch.indexOf("C"))).replaceAll("L","")).length.toString();
northWest = ((displayStitch.substring(0, displayStitch.indexOf("C"))).replaceAll("R","")).length.toString();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why toString in these expressions? You are treating them as integers below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because I added to min(...) later ...
The template-$ does not have to be a string.

Corrected.

Comment thread docs/js/stitch-gallery.js Outdated
if (southEast > 5) {southEast = 5}
if (southWest > 5) {southWest = 5}
if (northEast > 5) {northEast = 5}
if (northWest > 5) {northWest = 5}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you now of Math.min(5,X)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes.
Applied.

Comment thread docs/js/stitch-gallery.js Outdated
}

// copied from GF_stitches.setcolorcode()
colorCodeSvg = document.createElement("colorCodeSvg");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not a valid HTML tag

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Corrected.

Comment thread docs/js/stitch-gallery.js Outdated
${twistMarkerDash("twist-2",`${t2}` )}
${twistMarkerDash("twist-3",`${t3}` )}
${twistMarkerDash("twist-4",`${t4}` )}
${twistMarkerDash("twist-5",`${t5}` )}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why a formatted string and not just t1 etc?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Beginnersmistake.
Corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants