Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
6163b38a
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
8 个月 前同步成功
通知
1717
Star
78
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6163b38a
编写于
6月 05, 2023
作者:
A
Aarni Koskela
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Zoom and Pan: use for instead of forEach
上级
afbb0b5f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
10 deletion
+7
-10
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
+7
-10
未找到文件。
extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
浏览文件 @
6163b38a
...
@@ -150,17 +150,15 @@ onUiLoaded(async() => {
...
@@ -150,17 +150,15 @@ onUiLoaded(async() => {
const
elemData
=
{};
const
elemData
=
{};
// Apply functionality to the range inputs. Restore redmask and correct for long images.
// Apply functionality to the range inputs. Restore redmask and correct for long images.
const
rangeInputs
=
elements
.
rangeGroup
?
elements
.
rangeGroup
.
querySelectorAll
(
"
input
"
)
:
const
rangeInputs
=
elements
.
rangeGroup
?
Array
.
from
(
elements
.
rangeGroup
.
querySelectorAll
(
"
input
"
)
)
:
[
[
gradioApp
().
querySelector
(
"
#img2img_width input[type='range']
"
),
gradioApp
().
querySelector
(
"
#img2img_width input[type='range']
"
),
gradioApp
().
querySelector
(
"
#img2img_height input[type='range']
"
)
gradioApp
().
querySelector
(
"
#img2img_height input[type='range']
"
)
];
];
rangeInputs
.
forEach
(
input
=>
{
for
(
const
input
of
rangeInputs
)
{
if
(
input
)
{
input
?.
addEventListener
(
"
input
"
,
()
=>
restoreImgRedMask
(
elements
));
input
.
addEventListener
(
"
input
"
,
()
=>
restoreImgRedMask
(
elements
));
}
}
});
function
applyZoomAndPan
(
elemId
)
{
function
applyZoomAndPan
(
elemId
)
{
const
targetElement
=
gradioApp
().
querySelector
(
elemId
);
const
targetElement
=
gradioApp
().
querySelector
(
elemId
);
...
@@ -215,12 +213,11 @@ onUiLoaded(async() => {
...
@@ -215,12 +213,11 @@ onUiLoaded(async() => {
action
:
"
Move canvas
"
action
:
"
Move canvas
"
}
}
];
];
hotkeys
.
forEach
(
function
(
hotkey
)
{
for
(
const
hotkey
of
hotkeys
)
{
const
p
=
document
.
createElement
(
"
p
"
);
const
p
=
document
.
createElement
(
"
p
"
);
p
.
innerHTML
=
p
.
innerHTML
=
`<b>
${
hotkey
.
key
}
</b> -
${
hotkey
.
action
}
`
;
"
<b>
"
+
hotkey
.
key
+
"
</b>
"
+
"
-
"
+
hotkey
.
action
;
tooltipContent
.
appendChild
(
p
);
tooltipContent
.
appendChild
(
p
);
}
);
}
// Add information and content elements to the tooltip element
// Add information and content elements to the tooltip element
tooltip
.
appendChild
(
info
);
tooltip
.
appendChild
(
info
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录