mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 14:47:14 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
24a56f029a
10 changed files with 98 additions and 61 deletions
|
@ -330,10 +330,10 @@
|
|||
(defn bounding-rect->rect
|
||||
[rect]
|
||||
(when (some? rect)
|
||||
{:x (or (.-left rect) (:left rect))
|
||||
:y (or (.-top rect) (:top rect))
|
||||
:width (or (.-width rect) (:width rect))
|
||||
:height (or (.-height rect) (:height rect))}))
|
||||
{:x (or (.-left rect) (:left rect) 0)
|
||||
:y (or (.-top rect) (:top rect) 0)
|
||||
:width (or (.-width rect) (:width rect) 1)
|
||||
:height (or (.-height rect) (:height rect) 1)}))
|
||||
|
||||
(defn get-window-size
|
||||
[]
|
||||
|
@ -482,11 +482,21 @@
|
|||
(when (some? element)
|
||||
(.-scrollTop element)))
|
||||
|
||||
(defn get-h-scroll-pos
|
||||
[^js element]
|
||||
(when (some? element)
|
||||
(.-scrollLeft element)))
|
||||
|
||||
(defn set-scroll-pos!
|
||||
[^js element scroll]
|
||||
(when (some? element)
|
||||
(obj/set! element "scrollTop" scroll)))
|
||||
|
||||
(defn set-h-scroll-pos!
|
||||
[^js element scroll]
|
||||
(when (some? element)
|
||||
(obj/set! element "scrollLeft" scroll)))
|
||||
|
||||
(defn scroll-into-view!
|
||||
([^js element]
|
||||
(scroll-into-view! element false))
|
||||
|
|
|
@ -15,15 +15,10 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
goog.provide("app.util.normalize_wheel");
|
||||
goog.provide("app.util.dom.normalize_wheel");
|
||||
|
||||
goog.scope(function() {
|
||||
const self = app.util.normalize_wheel;
|
||||
|
||||
// const UserAgent_DEPRECATED = require('UserAgent_DEPRECATED');
|
||||
|
||||
// const isEventSupported = require('isEventSupported');
|
||||
|
||||
const self = app.util.dom.normalize_wheel;
|
||||
|
||||
// Reasonable defaults
|
||||
const PIXEL_STEP = 10;
|
||||
|
@ -174,6 +169,5 @@ goog.scope(function() {
|
|||
|
||||
|
||||
self.normalize_wheel = normalizeWheel;
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
[parent-node direction text-node]
|
||||
|
||||
(letfn [(parse-entry [^js entry]
|
||||
{:node (.-node entry)
|
||||
:position (dom/bounding-rect->rect (.-position entry))
|
||||
:text (.-text entry)
|
||||
:direction direction})]
|
||||
(when (some? (.-position entry))
|
||||
{:node (.-node entry)
|
||||
:position (dom/bounding-rect->rect (.-position entry))
|
||||
:text (.-text entry)
|
||||
:direction direction}))]
|
||||
(into
|
||||
[]
|
||||
(map parse-entry)
|
||||
(keep parse-entry)
|
||||
(tpd/parse-text-nodes parent-node text-node))))
|
||||
|
||||
(def load-promises (atom {}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue