1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-10 09:20:26 +00:00

remove some unnecessary calculations

This commit is contained in:
BurningTreeC 2024-10-04 16:55:27 +02:00
parent 035c23e0d5
commit f547be6b8e

View File

@ -2,14 +2,14 @@ title: $:/core/macros/sidebar-resizer
\procedure sidebar-resizer-pointerdown-actions()
<%if [[$:/state/sidebar/resizing]is[missing]then<event-mousebutton>match[left]then<modifier>match[normal]] %>
<$let dragDiff=<<event-fromselected-posx>> dragWidth=<<tv-selectednode-width>> rightDiff={{{ [<dragWidth>subtract<dragDiff>] }}} storyRiverWidth={{{ [<event-fromcatcher-posx>subtract<dragDiff>subtract[14]add[42]] }}} sidebarWidth={{{ [<tv-widgetnode-width>subtract<event-fromcatcher-posx>add<dragDiff>add[14]] }}}>
<$let dragDiff=<<event-fromselected-posx>> storyRiverWidth={{{ [<event-fromcatcher-posx>subtract<dragDiff>subtract[14]add[42]] }}} sidebarWidth={{{ [<tv-widgetnode-width>subtract<event-fromcatcher-posx>add<dragDiff>add[14]] }}}>
<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text={{{ [<storyRiverWidth>addsuffix[px]] }}}/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [<storyRiverWidth>addsuffix[px]] }}}/>
<% else %>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [<sidebarWidth>addsuffix[px]] }}}/>
<% endif %>
<$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-diff=<<dragDiff>> right-diff=<<rightDiff>>/>
<$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-diff=<<dragDiff>>/>
</$let>
<% endif %>
\end