@social-mail/social-mail-client 1.8.439 → 1.8.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.8.439",
3
+ "version": "1.8.440",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -217,12 +217,18 @@ const setCapture = (direction: string, editor: HtmlPageEditor, element: HTMLElem
217
217
  let sx = e.clientX;
218
218
  let sy = e.clientY;
219
219
 
220
+ const aspectRatio = element.offsetHeight / element.offsetWidth;
221
+
220
222
  const captureMove = (evt: PointerEvent) => {
221
223
  const dx = evt.clientX - sx;
222
- const dy = evt.clientY - sy;
224
+ let dy = evt.clientY - sy;
223
225
  if (dx === 0 && dy === 0) {
224
226
  return;
225
227
  }
228
+ if(evt.shiftKey || evt.ctrlKey) {
229
+ // fix aspect ratio...
230
+ dy = dx * aspectRatio;
231
+ }
226
232
  sx = evt.clientX;
227
233
  sy = evt.clientY;
228
234
  sc.move({ dx, dy, fx});