MCPcopy Create free account
hub / github.com/devforth/painterro / getAlphaAtClick

Method getAlphaAtClick

js/colorPicker.js:159–166  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

157 }
158
159 getAlphaAtClick(e) {
160 let x = e.clientX - this.canvasAlpha.documentOffsetLeft;
161 x = (x < 1 && 1) || x;
162 x = (x > this.w - 1 && this.w - 1) || x;
163 this.alphaPosition = x;
164 this.alphaRegulator.style.left = `${x}px`;
165 this.regetAlpha();
166 }
167
168 handleKeyDown(event) {
169 if (this.opened && event.keyCode === KEYS.enter) {

Callers 2

handleMouseDownMethod · 0.95
handleMouseMoveMethod · 0.95

Calls 1

regetAlphaMethod · 0.95

Tested by

no test coverage detected