Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
f831142b
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,发现更多精彩内容 >>
未验证
提交
f831142b
编写于
1月 24, 2022
作者:
B
Boris Sekachev
提交者:
GitHub
1月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Displaying shape size for ellipses (#4229)
* Displaying shape size for ellipses * Updated version
上级
f9e10ff0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
8 deletion
+10
-8
cvat-canvas/package-lock.json
cvat-canvas/package-lock.json
+2
-2
cvat-canvas/package.json
cvat-canvas/package.json
+1
-1
cvat-canvas/src/typescript/canvasView.ts
cvat-canvas/src/typescript/canvasView.ts
+1
-1
cvat-canvas/src/typescript/drawHandler.ts
cvat-canvas/src/typescript/drawHandler.ts
+4
-2
cvat-canvas/src/typescript/shared.ts
cvat-canvas/src/typescript/shared.ts
+2
-2
未找到文件。
cvat-canvas/package-lock.json
浏览文件 @
f831142b
{
"name"
:
"cvat-canvas"
,
"version"
:
"2.13.
0
"
,
"version"
:
"2.13.
1
"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"name"
:
"cvat-canvas"
,
"version"
:
"2.13.
0
"
,
"version"
:
"2.13.
1
"
,
"license"
:
"MIT"
,
"dependencies"
:
{
"@types/polylabel"
:
"^1.0.5"
,
...
...
cvat-canvas/package.json
浏览文件 @
f831142b
{
"name"
:
"cvat-canvas"
,
"version"
:
"2.13.
0
"
,
"version"
:
"2.13.
1
"
,
"description"
:
"Part of Computer Vision Annotation Tool which presents its canvas library"
,
"main"
:
"src/canvas.ts"
,
"scripts"
:
{
...
...
cvat-canvas/src/typescript/canvasView.ts
浏览文件 @
f831142b
...
...
@@ -2038,7 +2038,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
resized
=
false
;
hideDirection
();
hideText
();
if
(
state
.
shapeType
===
'
rectangle
'
)
{
if
(
state
.
shapeType
===
'
rectangle
'
||
state
.
shapeType
===
'
ellipse
'
)
{
shapeSizeElement
=
displayShapeSize
(
this
.
adoptedContent
,
this
.
adoptedText
);
}
(
shape
as
any
).
on
(
'
remove.resize
'
,
()
=>
{
...
...
cvat-canvas/src/typescript/drawHandler.ts
浏览文件 @
f831142b
// Copyright (C) 2019-202
1
Intel Corporation
// Copyright (C) 2019-202
2
Intel Corporation
//
// SPDX-License-Identifier: MIT
...
...
@@ -469,6 +469,7 @@ export class DrawHandlerImpl implements DrawHandler {
const
cy
=
initialPoint
.
y
+
ry
*
Math
.
sign
(
translated
[
1
]
-
initialPoint
.
y
);
this
.
drawInstance
.
center
(
cx
,
cy
);
this
.
drawInstance
.
radius
(
rx
,
ry
);
this
.
shapeSizeElement
.
update
(
this
.
drawInstance
);
}
});
}
...
...
@@ -966,6 +967,7 @@ export class DrawHandlerImpl implements DrawHandler {
this
.
drawPoints
();
}
else
if
(
this
.
drawData
.
shapeType
===
'
ellipse
'
)
{
this
.
drawEllipse
();
this
.
shapeSizeElement
=
displayShapeSize
(
this
.
canvas
,
this
.
text
);
}
else
if
(
this
.
drawData
.
shapeType
===
'
cuboid
'
)
{
if
(
this
.
drawData
.
cuboidDrawingMethod
===
CuboidDrawingMethod
.
CORNER_POINTS
)
{
this
.
drawCuboidBy4Points
();
...
...
@@ -1050,7 +1052,7 @@ export class DrawHandlerImpl implements DrawHandler {
public
transform
(
geometry
:
Geometry
):
void
{
this
.
geometry
=
geometry
;
if
(
this
.
shapeSizeElement
&&
this
.
drawInstance
&&
this
.
drawData
.
shapeType
===
'
rectangle
'
)
{
if
(
this
.
shapeSizeElement
&&
this
.
drawInstance
&&
[
'
rectangle
'
,
'
ellipse
'
].
includes
(
this
.
drawData
.
shapeType
)
)
{
this
.
shapeSizeElement
.
update
(
this
.
drawInstance
);
}
...
...
cvat-canvas/src/typescript/shared.ts
浏览文件 @
f831142b
// Copyright (C) 2019-202
1
Intel Corporation
// Copyright (C) 2019-202
2
Intel Corporation
//
// SPDX-License-Identifier: MIT
...
...
@@ -97,7 +97,7 @@ export function displayShapeSize(shapesContainer: SVG.Container, textContainer:
.
addClass
(
'
cvat_canvas_text
'
),
update
(
shape
:
SVG
.
Shape
):
void
{
let
text
=
`
${
Math
.
round
(
shape
.
width
())}
x
${
Math
.
round
(
shape
.
height
())}
px`
;
if
(
shape
.
type
===
'
rect
'
)
{
if
(
shape
.
type
===
'
rect
'
||
shape
.
type
===
'
ellipse
'
)
{
let
rotation
=
shape
.
transform
().
rotation
||
0
;
// be sure, that rotation in range [0; 360]
while
(
rotation
<
0
)
rotation
+=
360
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录