Skip to content

Commit

Permalink
alpha 29
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHardIce committed Jun 14, 2022
1 parent f5b00c8 commit b57c18e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It uses [Capra](https://github.com/MikeHardIce/Capra) underneath (it was using [
In project.clj:

```
:dependencies [[strigui "0.0.1-alpha28"]]
:dependencies [[strigui "0.0.1-alpha29"]]
```
[Example](https://github.com/MikeHardIce/strigui-sample)

Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject strigui "0.0.1-alpha28"
(defproject strigui "0.0.1-alpha29"
:description "A small GUI library."
:url "https://github.com/MikeHardIce/strigui"
:license {:name "MIT License"
Expand Down
10 changes: 3 additions & 7 deletions src/strigui/widget.clj
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,9 @@
after (f before)
updated-keys (determine-updated-keys before after)
to-redraw (determine-widgets-to-redraw before after updated-keys)
with-position-changes (determine-old-widgets-to-hide to-redraw before updated-keys)
;;with-position-changes (determine-old-widgets-to-hide to-redraw before updated-keys)
to-hide (determine-old-widgets-to-hide before after updated-keys)
;; maybe only use the neighbouts of widgets whois size or position has changed
neighbours (merge (widgets->neighbours canvas with-position-changes after)
(widgets->neighbours canvas to-redraw after >)
(widgets->neighbours canvas to-hide after <))]
neighbours (widgets->neighbours canvas to-redraw after)]
(c/use-buffer-> canvas
(doseq [to-hide (vals to-hide)]
(hide! to-hide canvas))
Expand All @@ -287,8 +284,7 @@
(draw-widgets! canvas widgets-to-draw)
(let [widgets-to-draw (map after-drawing widgets-to-draw)
after (merge-with into after (mapcat #(merge {(:name %) %}) widgets-to-draw))]
(swap! state assoc :widgets after)))))
)
(swap! state assoc :widgets after))))))
(catch Exception e (str "Failed to update widgets, perhaps the given function" \newline
"doesn't take or doesn't return a widgets map." \newline
"Exception: " (.getMessage e)))))
Expand Down

0 comments on commit b57c18e

Please sign in to comment.