Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
4a64d340
Commit
4a64d340
authored
Aug 09, 2023
by
Danil Boldyrev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix auto-expand
parent
e12a1be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
+8
-5
No files found.
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
View file @
4a64d340
...
...
@@ -42,6 +42,11 @@ onUiLoaded(async() => {
}
}
// Detect whether the element has a horizontal scroll bar
function
hasHorizontalScrollbar
(
element
)
{
return
element
.
scrollWidth
>
element
.
clientWidth
;
}
// Function for defining the "Ctrl", "Shift" and "Alt" keys
function
isModifierKey
(
event
,
key
)
{
switch
(
key
)
{
...
...
@@ -650,16 +655,14 @@ onUiLoaded(async() => {
}
// Simulation of the function to put a long image into the screen.
// We de
fine the size of the canvas
, make a fullscreen to reveal the image, then reduce it to fit into the element.
// We de
tect if an image has a scroll bar or not
, make a fullscreen to reveal the image, then reduce it to fit into the element.
// We hide the image and show it to the user when it is ready.
function
autoExpand
(
e
)
{
const
canvas
=
document
.
querySelector
(
`
${
elemId
}
canvas[key="interface"]`
);
const
isMainTab
=
activeElement
===
elementIDs
.
inpaint
||
activeElement
===
elementIDs
.
inpaintSketch
||
activeElement
===
elementIDs
.
sketch
;
if
(
canvas
&&
isMainTab
)
{
if
(
canvas
&&
parseInt
(
targetElement
.
style
.
width
)
>
862
||
parseInt
(
canvas
.
width
)
<
862
)
{
return
;
}
if
(
canvas
)
{
if
(
hasHorizontalScrollbar
(
targetElement
))
{
targetElement
.
style
.
visibility
=
"
hidden
"
;
setTimeout
(()
=>
{
fitToScreen
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment