0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 17:18:21 -05:00

Improved rules positioning.

This commit is contained in:
Andrey Antukh 2016-02-12 18:50:51 +02:00
parent e6e7115e14
commit 5e8f741c2f
3 changed files with 9 additions and 14 deletions

View file

@ -5,6 +5,7 @@
overflow: scroll; overflow: scroll;
width: 100%; width: 100%;
transition: none; transition: none;
position: relative;
&.no-tool-bar-right { &.no-tool-bar-right {
margin-right: 0; margin-right: 0;

View file

@ -72,12 +72,12 @@
;; Pages management lightbox ;; Pages management lightbox
;; (pagesmngr) ;; (pagesmngr)
;; Rules
(h-rule left-sidebar?)
(v-rule left-sidebar?)
;; Canvas ;; Canvas
[:section.workspace-canvas {:class classes :on-scroll on-scroll} [:section.workspace-canvas {:class classes :on-scroll on-scroll}
;; Rules
(h-rule left-sidebar?)
(v-rule left-sidebar?)
(when (and (:selected workspace) (when (and (:selected workspace)
(= (count (:selected workspace)) 1)) (= (count (:selected workspace)) 1))
(let [shape-id (first (:selected workspace)) (let [shape-id (first (:selected workspace))

View file

@ -95,13 +95,11 @@
[own sidebar?] [own sidebar?]
(let [width wb/viewport-width (let [width wb/viewport-width
ticks (concat (range (- step-padding start-width) 0 step-size) ticks (concat (range (- step-padding start-width) 0 step-size)
(range 0 (- width start-width step-padding) step-size)) (range 0 (- width start-width step-padding) step-size))]
padding (if sidebar? 250 0)]
(html (html
[:svg.horizontal-rule [:svg.horizontal-rule
{:width 3000 {:width 3000
:height 3000 :height 3000}
:style {:left (str padding "px")}}
[:g [:g
[:rect {:x step-padding :y 0 :width width :height step-padding :fill "#bab7b7"}] [:rect {:x step-padding :y 0 :width width :height step-padding :fill "#bab7b7"}]
[:rect {:x 0 :y 0 :width step-padding :height step-padding :fill "#bab7b7"}]] [:rect {:x 0 :y 0 :width step-padding :height step-padding :fill "#bab7b7"}]]
@ -120,15 +118,11 @@
[own sidebar?] [own sidebar?]
(let [height wb/viewport-height (let [height wb/viewport-height
ticks (concat (range (- step-padding start-height) 0 step-size) ticks (concat (range (- step-padding start-height) 0 step-size)
(range 0 (- height start-height step-padding) step-size)) (range 0 (- height start-height step-padding) step-size))]
padding (if sidebar?
250
0)]
(html (html
[:svg.vertical-rule [:svg.vertical-rule
{:width 3000 {:width 3000
:height 3000 :height 3000}
:style {:left (str padding "px")}}
[:g [:g
[:rect {:x 0 :y step-padding :height height :width step-padding :fill "#bab7b7"}] [:rect {:x 0 :y step-padding :height height :width step-padding :fill "#bab7b7"}]
(for [tick ticks (for [tick ticks