Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
d789087d
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d789087d
编写于
3月 24, 2020
作者:
B
Boris Sekachev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed ui failing in propagate confirmation
上级
b12ae347
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
63 addition
and
24 deletion
+63
-24
cvat-ui/src/components/annotation-page/standard-workspace/propagate-confirm.tsx
.../annotation-page/standard-workspace/propagate-confirm.tsx
+34
-7
cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx
.../components/annotation-page/top-bar/player-navigation.tsx
+6
-1
cvat-ui/src/components/settings-page/player-settings.tsx
cvat-ui/src/components/settings-page/player-settings.tsx
+8
-3
cvat-ui/src/components/settings-page/workspace-settings.tsx
cvat-ui/src/components/settings-page/workspace-settings.tsx
+6
-4
cvat-ui/src/containers/annotation-page/standard-workspace/propagate-confirm.tsx
.../annotation-page/standard-workspace/propagate-confirm.tsx
+9
-9
未找到文件。
cvat-ui/src/components/annotation-page/standard-workspace/propagate-confirm.tsx
浏览文件 @
d789087d
...
...
@@ -4,17 +4,17 @@
import
React
from
'
react
'
;
import
{
Modal
,
InputNumber
,
}
from
'
antd
'
;
import
Modal
from
'
antd/lib/modal
'
;
import
InputNumber
from
'
antd/lib/input-number
'
;
import
Text
from
'
antd/lib/typography/Text
'
;
import
{
clamp
}
from
'
utils/math
'
;
interface
Props
{
visible
:
boolean
;
propagateFrames
:
number
;
propagateUpToFrame
:
number
;
stopFrame
:
number
;
frameNumber
:
number
;
propagateObject
():
void
;
cancel
():
void
;
changePropagateFrames
(
value
:
number
|
undefined
):
void
;
...
...
@@ -26,12 +26,16 @@ export default function PropagateConfirmComponent(props: Props): JSX.Element {
visible
,
propagateFrames
,
propagateUpToFrame
,
stopFrame
,
frameNumber
,
propagateObject
,
changePropagateFrames
,
changeUpToFrame
,
cancel
,
}
=
props
;
const
minPropagateFrames
=
1
;
return
(
<
Modal
okType
=
'primary'
...
...
@@ -44,14 +48,37 @@ export default function PropagateConfirmComponent(props: Props): JSX.Element {
>
<
div
className
=
'cvat-propagate-confirm'
>
<
Text
>
Do you want to make a copy of the object on
</
Text
>
<
InputNumber
size
=
'small'
min
=
{
1
}
value
=
{
propagateFrames
}
onChange
=
{
changePropagateFrames
}
/>
<
InputNumber
size
=
'small'
min
=
{
minPropagateFrames
}
value
=
{
propagateFrames
}
onChange
=
{
(
value
:
number
|
undefined
)
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
changePropagateFrames
(
Math
.
floor
(
clamp
(
value
,
minPropagateFrames
,
Number
.
MAX_SAFE_INTEGER
),
));
}
}
}
/>
{
propagateFrames
>
1
?
<
Text
>
frames
</
Text
>
:
<
Text
>
frame
</
Text
>
}
<
Text
>
up to the
</
Text
>
<
InputNumber
size
=
'small'
value
=
{
propagateUpToFrame
}
onChange
=
{
changeUpToFrame
}
/>
<
InputNumber
size
=
'small'
value
=
{
propagateUpToFrame
}
min
=
{
frameNumber
+
1
}
max
=
{
stopFrame
}
onChange
=
{
(
value
:
number
|
undefined
)
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
changeUpToFrame
(
Math
.
floor
(
clamp
(
value
,
frameNumber
+
1
,
stopFrame
),
));
}
}
}
/>
<
Text
>
frame
</
Text
>
</
div
>
</
Modal
>
...
...
cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx
浏览文件 @
d789087d
...
...
@@ -35,6 +35,9 @@ function PlayerNavigation(props: Props): JSX.Element {
}
=
props
;
const
[
frameInputValue
,
setFrameInputValue
]
=
useState
<
number
|
undefined
>
(
frameNumber
);
if
(
frameNumber
!==
frameInputValue
)
{
setFrameInputValue
(
frameNumber
);
}
return
(
<>
...
...
@@ -71,7 +74,9 @@ function PlayerNavigation(props: Props): JSX.Element {
// https://stackoverflow.com/questions/38256332/in-react-whats-the-difference-between-onchange-and-oninput
onChange
=
{
(
value
:
number
|
undefined
)
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
setFrameInputValue
(
clamp
(
value
,
stopFrame
,
startFrame
));
setFrameInputValue
(
Math
.
floor
(
clamp
(
value
,
stopFrame
,
startFrame
),
));
}
}
}
onBlur
=
{
()
=>
{
...
...
cvat-ui/src/components/settings-page/player-settings.tsx
浏览文件 @
d789087d
...
...
@@ -84,7 +84,11 @@ export default function PlayerSettingsComponent(props: Props): JSX.Element {
value
=
{
frameStep
}
onChange
=
{
(
value
:
number
|
undefined
):
void
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
onChangeFrameStep
(
clamp
(
value
,
minFrameStep
,
maxFrameStep
));
onChangeFrameStep
(
Math
.
floor
(
clamp
(
value
,
minFrameStep
,
maxFrameStep
),
),
);
}
}
}
/>
...
...
@@ -135,12 +139,13 @@ export default function PlayerSettingsComponent(props: Props): JSX.Element {
<
InputNumber
min
=
{
minGridSize
}
max
=
{
maxGridSize
}
step
=
{
1
}
value
=
{
gridSize
}
disabled
=
{
!
grid
}
onChange
=
{
(
value
:
number
|
undefined
):
void
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
onChangeGridSize
(
clamp
(
value
,
minGridSize
,
maxGridSize
));
onChangeGridSize
(
Math
.
floor
(
clamp
(
value
,
minGridSize
,
maxGridSize
),
));
}
}
}
/>
...
...
cvat-ui/src/components/settings-page/workspace-settings.tsx
浏览文件 @
d789087d
...
...
@@ -64,13 +64,13 @@ export default function WorkspaceSettingsComponent(props: Props): JSX.Element {
value
=
{
Math
.
round
(
autoSaveInterval
/
(
60
*
1000
))
}
onChange
=
{
(
value
:
number
|
undefined
):
void
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
onChangeAutoSaveInterval
(
onChangeAutoSaveInterval
(
Math
.
floor
(
clamp
(
value
,
minAutoSaveInterval
,
maxAutoSaveInterval
,
)
*
60
*
1000
,
);
),
)
*
60
*
1000
)
;
}
}
}
/>
...
...
@@ -102,7 +102,9 @@ export default function WorkspaceSettingsComponent(props: Props): JSX.Element {
value
=
{
aamZoomMargin
}
onChange
=
{
(
value
:
number
|
undefined
):
void
=>
{
if
(
typeof
(
value
)
===
'
number
'
)
{
onChangeAAMZoomMargin
(
clamp
(
value
,
minAAMMargin
,
maxAAMMargin
));
onChangeAAMZoomMargin
(
Math
.
floor
(
clamp
(
value
,
minAAMMargin
,
maxAAMMargin
),
));
}
}
}
/>
...
...
cvat-ui/src/containers/annotation-page/standard-workspace/propagate-confirm.tsx
浏览文件 @
d789087d
...
...
@@ -13,6 +13,7 @@ import {
import
{
CombinedState
}
from
'
reducers/interfaces
'
;
import
PropagateConfirmComponent
from
'
components/annotation-page/standard-workspace/propagate-confirm
'
;
import
{
clamp
}
from
'
utils/math
'
;
interface
StateToProps
{
objectState
:
any
|
null
;
...
...
@@ -88,23 +89,20 @@ class PropagateConfirmContainer extends React.PureComponent<Props> {
propagateObject
(
jobInstance
,
objectState
,
frameNumber
+
1
,
propagateUpToFrame
);
};
private
changePropagateFrames
=
(
value
:
number
|
undefined
):
void
=>
{
private
changePropagateFrames
=
(
value
:
number
):
void
=>
{
const
{
changePropagateFrames
}
=
this
.
props
;
if
(
typeof
(
value
)
!==
'
undefined
'
)
{
changePropagateFrames
(
value
);
}
changePropagateFrames
(
value
);
};
private
changeUpToFrame
=
(
value
:
number
|
undefined
):
void
=>
{
private
changeUpToFrame
=
(
value
:
number
):
void
=>
{
const
{
stopFrame
,
frameNumber
,
changePropagateFrames
,
}
=
this
.
props
;
if
(
typeof
(
value
)
!==
'
undefined
'
)
{
const
propagateFrames
=
Math
.
max
(
0
,
Math
.
min
(
stopFrame
,
value
))
-
frameNumber
;
changePropagateFrames
(
propagateFrames
);
}
const
propagateFrames
=
Math
.
max
(
0
,
Math
.
min
(
stopFrame
,
value
))
-
frameNumber
;
changePropagateFrames
(
propagateFrames
);
};
public
render
():
JSX
.
Element
{
...
...
@@ -122,6 +120,8 @@ class PropagateConfirmContainer extends React.PureComponent<Props> {
<
PropagateConfirmComponent
visible
=
{
objectState
!==
null
}
propagateUpToFrame
=
{
propagateUpToFrame
}
stopFrame
=
{
stopFrame
}
frameNumber
=
{
frameNumber
}
propagateFrames
=
{
propagateUpToFrame
-
frameNumber
}
propagateObject
=
{
this
.
propagateObject
}
changePropagateFrames
=
{
this
.
changePropagateFrames
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录