Skip to content

Commit

Permalink
Mask heading text
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhanshuguptagit committed Jan 12, 2024
1 parent 20fd287 commit c5915ba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/bean/ui/views/sheet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@
text
#js {:fontName "SpaceGrotesk"
:tint (:heading-color styles/colors)
:fontSize (:heading-font-size styles/sizes)})]
(->> (center-text! bitmap x y h w) (.addChild g))))
:fontSize (:heading-font-size styles/sizes)})
mask (new pixi/Graphics)]
(->> (center-text! bitmap x y h w) (.addChild g))
(-> mask (.beginFill 0xffffff) (.drawRect x y w h) .endFill)
(set! (.-mask (.addChild g mask)) mask)))

(defn- cell-text [^js g text x y h w error?]
(let [bitmap (new pixi/BitmapText text
Expand All @@ -83,10 +86,8 @@
mask (new pixi/Graphics)]
(set! (.-x bitmap) (+ x (:cell-padding styles/sizes)))
(set! (.-y bitmap) (+ y (:cell-padding styles/sizes)))
(.beginFill mask 0xffffff)
(.drawRect mask x y w h)
(.endFill mask)
(.addChild g mask)
(-> mask (.beginFill 0xffffff) (.drawRect x y w h) .endFill)
(set! (.-mask bitmap) mask)
(.addChild g bitmap)))

Expand Down

0 comments on commit c5915ba

Please sign in to comment.