diff --git a/article.js b/article.js index 17b898cf..ab494109 100644 --- a/article.js +++ b/article.js @@ -31092,6 +31092,11 @@ } }, + onClickWithRedraw: function onClickWithRedraw(evt, api) { + this.onClick(evt, api); + api.redraw(); + }, + onClick: function onClick(evt, api) { api.t = api.curve.on({ x: evt.offsetX, y: evt.offsetY }, 7); if (api.t < 0.05 || api.t > 0.95) api.t = false; @@ -31297,8 +31302,10 @@ React.createElement( "div", { className: "figure" }, - React.createElement(Graphic, { inline: true, preset: "abc", title: "Projections in a quadratic Bézier curve", setup: this.setupQuadratic, draw: this.draw, onClick: this.onClick }), - React.createElement(Graphic, { inline: true, preset: "abc", title: "Projections in a cubic Bézier curve", setup: this.setupCubic, draw: this.draw, onClick: this.onClick }) + React.createElement(Graphic, { inline: true, preset: "abc", title: "Projections in a quadratic Bézier curve", + setup: this.setupQuadratic, draw: this.draw, onClick: this.onClickWithRedraw }), + React.createElement(Graphic, { inline: true, preset: "abc", title: "Projections in a cubic Bézier curve", + setup: this.setupCubic, draw: this.draw, onClick: this.onClickWithRedraw }) ), React.createElement( "p", diff --git a/components/sections/moulding/index.js b/components/sections/moulding/index.js index 90709626..c1b66165 100644 --- a/components/sections/moulding/index.js +++ b/components/sections/moulding/index.js @@ -74,6 +74,11 @@ var Moulding = React.createClass({ } }, + onClickWithRedraw: function(evt, api) { + this.onClick(evt, api); + api.redraw(); + }, + onClick: function(evt, api) { api.t = api.curve.on({x: evt.offsetX, y: evt.offsetY},7); if (api.t < 0.05 || api.t > 0.95) api.t = false; @@ -241,8 +246,10 @@ var Moulding = React.createClass({ Note the "ratio" value when you do so: does it change?):
So, what exactly do we see in these graphics? First off, there's the three points A, B and C.