Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2bc77436
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2bc77436
编写于
11月 21, 2019
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove no longer necessary minimap font creator
上级
17de08a8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
144 deletion
+0
-144
src/vs/editor/test/browser/view/minimapFontCreator.html
src/vs/editor/test/browser/view/minimapFontCreator.html
+0
-25
src/vs/editor/test/browser/view/minimapFontCreator.ts
src/vs/editor/test/browser/view/minimapFontCreator.ts
+0
-119
未找到文件。
src/vs/editor/test/browser/view/minimapFontCreator.html
已删除
100644 → 0
浏览文件 @
17de08a8
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<style>
</style>
</head>
<body
style=
"background:black"
>
<canvas
id=
"my-canvas"
></canvas>
<script
src=
"../../../../loader.js"
></script>
<script>
require
.
config
({
baseUrl
:
'
../../../../../../out
'
});
require
([
'
vs/editor/test/browser/view/minimapFontCreator
'
],
function
()
{
});
</script>
</body>
</html>
\ No newline at end of file
src/vs/editor/test/browser/view/minimapFontCreator.ts
已删除
100644 → 0
浏览文件 @
17de08a8
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
RGBA8
}
from
'
vs/editor/common/core/rgba
'
;
import
{
MinimapCharRenderer
}
from
'
vs/editor/browser/viewParts/minimap/minimapCharRenderer
'
;
import
{
Constants
}
from
'
vs/editor/browser/viewParts/minimap/minimapCharSheet
'
;
import
{
MinimapCharRendererFactory
}
from
'
vs/editor/browser/viewParts/minimap/minimapCharRendererFactory
'
;
let
sampleData
=
MinimapCharRendererFactory
.
createSampleData
(
'
monospace
'
);
let
minimapCharRenderer1x
=
MinimapCharRendererFactory
.
createFromSampleData
(
sampleData
.
data
,
1
);
let
minimapCharRenderer2x
=
MinimapCharRendererFactory
.
createFromSampleData
(
sampleData
.
data
,
2
);
let
minimapCharRenderer4x
=
MinimapCharRendererFactory
.
createFromSampleData
(
sampleData
.
data
,
4
);
let
minimapCharRenderer6x
=
MinimapCharRendererFactory
.
createFromSampleData
(
sampleData
.
data
,
6
);
renderImageData
(
sampleData
,
10
,
100
);
renderMinimapCharRenderer
(
minimapCharRenderer1x
,
400
,
1
);
renderMinimapCharRenderer
(
minimapCharRenderer2x
,
500
,
2
);
renderMinimapCharRenderer
(
minimapCharRenderer4x
,
600
,
4
);
renderMinimapCharRenderer
(
minimapCharRenderer6x
,
750
,
8
);
function
createFakeImageData
(
width
:
number
,
height
:
number
):
ImageData
{
return
{
width
:
width
,
height
:
height
,
data
:
new
Uint8ClampedArray
(
width
*
height
*
Constants
.
RGBA_CHANNELS_CNT
)
};
}
function
renderMinimapCharRenderer
(
minimapCharRenderer
:
MinimapCharRenderer
,
y
:
number
,
scale
:
number
):
void
{
let
background
=
new
RGBA8
(
0
,
0
,
0
,
255
);
let
color
=
new
RGBA8
(
255
,
255
,
255
,
255
);
{
let
x2
=
createFakeImageData
(
Constants
.
BASE_CHAR_WIDTH
*
scale
*
Constants
.
CHAR_COUNT
,
Constants
.
BASE_CHAR_HEIGHT
*
scale
);
// set the background color
for
(
let
i
=
0
,
len
=
x2
.
data
.
length
/
4
;
i
<
len
;
i
++
)
{
x2
.
data
[
4
*
i
+
0
]
=
background
.
r
;
x2
.
data
[
4
*
i
+
1
]
=
background
.
g
;
x2
.
data
[
4
*
i
+
2
]
=
background
.
b
;
x2
.
data
[
4
*
i
+
3
]
=
255
;
}
let
dx
=
0
;
for
(
let
chCode
=
Constants
.
START_CH_CODE
;
chCode
<=
Constants
.
END_CH_CODE
;
chCode
++
)
{
minimapCharRenderer
.
renderChar
(
x2
,
dx
,
0
,
chCode
,
color
,
background
,
false
);
dx
+=
Constants
.
BASE_CHAR_WIDTH
*
scale
;
}
renderImageData
(
x2
,
10
,
y
);
}
}
(
function
()
{
let
r
=
'
let x2Data = [
'
,
offset
=
0
;
for
(
let
charIndex
=
0
;
charIndex
<
Constants
.
CHAR_COUNT
;
charIndex
++
)
{
let
charCode
=
charIndex
+
Constants
.
START_CH_CODE
;
r
+=
'
\n\n
//
'
+
String
.
fromCharCode
(
charCode
);
for
(
let
i
=
0
;
i
<
Constants
.
BASE_CHAR_HEIGHT
*
2
;
i
++
)
{
if
(
i
%
2
===
0
)
{
r
+=
'
\n
'
;
}
r
+=
(
minimapCharRenderer2x
as
any
).
charDataNormal
[
offset
]
+
'
,
'
;
offset
++
;
}
}
r
+=
'
\n\n
]
'
;
console
.
log
(
r
);
})();
(
function
()
{
let
r
=
'
let x1Data = [
'
,
offset
=
0
;
for
(
let
charIndex
=
0
;
charIndex
<
Constants
.
CHAR_COUNT
;
charIndex
++
)
{
let
charCode
=
charIndex
+
Constants
.
START_CH_CODE
;
r
+=
'
\n\n
//
'
+
String
.
fromCharCode
(
charCode
);
for
(
let
i
=
0
;
i
<
Constants
.
BASE_CHAR_HEIGHT
*
Constants
.
BASE_CHAR_WIDTH
;
i
++
)
{
r
+=
'
\n
'
;
r
+=
(
minimapCharRenderer1x
as
any
).
charDataNormal
[
offset
]
+
'
,
'
;
offset
++
;
}
}
r
+=
'
\n\n
]
'
;
console
.
log
(
r
);
})();
function
renderImageData
(
imageData
:
ImageData
,
left
:
number
,
top
:
number
):
void
{
let
output
=
''
;
let
offset
=
0
;
let
PX_SIZE
=
15
;
for
(
let
i
=
0
;
i
<
imageData
.
height
;
i
++
)
{
for
(
let
j
=
0
;
j
<
imageData
.
width
;
j
++
)
{
let
R
=
imageData
.
data
[
offset
];
let
G
=
imageData
.
data
[
offset
+
1
];
let
B
=
imageData
.
data
[
offset
+
2
];
let
A
=
imageData
.
data
[
offset
+
3
];
offset
+=
4
;
output
+=
`<div style="position:absolute;top:
${
PX_SIZE
*
i
}
px;left:
${
PX_SIZE
*
j
}
px;width:
${
PX_SIZE
}
px;height:
${
PX_SIZE
}
px;background:rgba(
${
R
}
,
${
G
}
,
${
B
}
,
${
A
/
256
}
)"></div>`
;
}
}
let
domNode
=
document
.
createElement
(
'
div
'
);
domNode
.
style
.
position
=
'
absolute
'
;
domNode
.
style
.
top
=
top
+
'
px
'
;
domNode
.
style
.
left
=
left
+
'
px
'
;
domNode
.
style
.
width
=
imageData
.
width
*
PX_SIZE
+
'
px
'
;
domNode
.
style
.
height
=
imageData
.
height
*
PX_SIZE
+
'
px
'
;
domNode
.
style
.
border
=
'
1px solid #ccc
'
;
domNode
.
style
.
background
=
'
#000000
'
;
domNode
.
innerHTML
=
output
;
document
.
body
.
appendChild
(
domNode
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录