Back

lines (clj)

(source)

function

(lines s)
Return a list of the lines in the string.

Examples

penpot/penpot
(ns app.main.ui.workspace.viewport.debug
  (:require
   [app.common.data :as d]
   [app.common.data.macros :as dm]
   [app.common.files.helpers :as cfh]
   [app.common.geom.point :as gpt]
   [app.common.geom.shapes :as gsh]
   [app.common.geom.shapes.flex-layout :as gsl]
   [app.common.geom.shapes.grid-layout :as gsg]
   [app.common.geom.shapes.points :as gpo]
   [app.common.types.shape.layout :as ctl]
   [app.common.uuid :as uuid]
   [cuerdas.core :as str]
   [rumext.v2 :as mf]))

(mf/defc debug-layout-lines
  "Debug component to show the auto-layout drop areas"
  {::mf/wrap-props false}
  [props]

            layout-bounds (:layout-bounds layout-data)
            xv   #(gpo/start-hv layout-bounds %)
            yv   #(gpo/start-vv layout-bounds %)]
        [:g.debug-layout {:pointer-events "none"}
         (for [[idx {:keys [start-p line-width line-height layout-gap-row layout-gap-col num-children]}] (d/enumerate (:layout-lines layout-data))]
           (let [line-width (if row? (+ line-width (* (dec num-children) layout-gap-row)) line-width)
                 line-height (if col? (+ line-height (* (dec num-children) layout-gap-col)) line-height)