File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.2.0</Version >
4+ <Version >9.2.0-beta01 </Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change @@ -134,11 +134,17 @@ export function init(id) {
134134}
135135
136136const update = el => {
137- const width = el . offsetWidth / 2 ;
137+
138138 const height = el . offsetHeight / 2 ;
139+ const marginTop = parseFloat ( getComputedStyle ( el ) . marginTop ) ;
140+ const viewBoxHeight = window . innerHeight / 2 ;
141+ if ( viewBoxHeight - height - marginTop > 0 ) {
142+ el . style . setProperty ( "margin-top" , `calc(50vh - ${ height } px)` ) ;
143+ }
139144
145+ const width = el . offsetWidth / 2 ;
140146 el . style . setProperty ( "margin-left" , `calc(50vw - ${ width } px)` ) ;
141- el . style . setProperty ( "margin-top" , `calc(50vh - ${ height } px)` ) ;
147+
142148 el . classList . remove ( 'is-draggable-center' ) ;
143149}
144150
You can’t perform that action at this time.
0 commit comments