Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
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
nanahira
Taiko Web
Commits
3a92a9c9
Commit
3a92a9c9
authored
Nov 21, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View: Fix layeredText offset
parent
3c701dc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
26 deletions
+30
-26
public/src/js/canvasdraw.js
public/src/js/canvasdraw.js
+4
-4
public/src/js/songselect.js
public/src/js/songselect.js
+23
-20
public/src/js/view.js
public/src/js/view.js
+3
-2
No files found.
public/src/js/canvasdraw.js
View file @
3a92a9c9
...
@@ -617,7 +617,7 @@
...
@@ -617,7 +617,7 @@
ctx
.
scale
(
scale
,
1
)
ctx
.
scale
(
scale
,
1
)
}
}
ctx
.
font
=
config
.
fontSize
+
"
px
"
+
config
.
fontFamily
ctx
.
font
=
config
.
fontSize
+
"
px
"
+
config
.
fontFamily
ctx
.
textBaseline
=
"
top
"
ctx
.
textBaseline
=
config
.
baseline
||
"
top
"
ctx
.
textAlign
=
"
center
"
ctx
.
textAlign
=
"
center
"
for
(
let
layer
of
layers
){
for
(
let
layer
of
layers
){
...
@@ -803,15 +803,15 @@
...
@@ -803,15 +803,15 @@
ctx
.
lineWidth
=
6
ctx
.
lineWidth
=
6
ctx
.
beginPath
()
ctx
.
beginPath
()
if
(
!
config
.
side
){
if
(
!
config
.
side
){
var
textX
=
config
.
two
?
2
0
:
17
var
textX
=
config
.
two
?
2
2
:
20
ctx
.
moveTo
(
48
,
120
)
ctx
.
moveTo
(
48
,
120
)
ctx
.
arc
(
48
,
48.5
,
45
,
Math
.
PI
*
0.58
,
Math
.
PI
*
0.42
)
ctx
.
arc
(
48
,
48.5
,
45
,
Math
.
PI
*
0.58
,
Math
.
PI
*
0.42
)
}
else
if
(
config
.
two
){
}
else
if
(
config
.
two
){
var
textX
=
7
0
var
textX
=
7
2
ctx
.
moveTo
(
56
,
115
)
ctx
.
moveTo
(
56
,
115
)
ctx
.
arc
(
98
,
48.5
,
45
,
Math
.
PI
*
0.75
,
Math
.
PI
*
0.59
)
ctx
.
arc
(
98
,
48.5
,
45
,
Math
.
PI
*
0.75
,
Math
.
PI
*
0.59
)
}
else
{
}
else
{
var
textX
=
-
3
3
var
textX
=
-
3
0
ctx
.
moveTo
(
39
,
115
)
ctx
.
moveTo
(
39
,
115
)
ctx
.
arc
(
-
2
,
48.5
,
45
,
Math
.
PI
*
0.41
,
Math
.
PI
*
0.25
)
ctx
.
arc
(
-
2
,
48.5
,
45
,
Math
.
PI
*
0.41
,
Math
.
PI
*
0.25
)
}
}
...
...
public/src/js/songselect.js
View file @
3a92a9c9
...
@@ -372,7 +372,7 @@ class SongSelect{
...
@@ -372,7 +372,7 @@ class SongSelect{
var
touch
=
true
var
touch
=
true
}
}
if
(
this
.
state
.
screen
===
"
song
"
){
if
(
this
.
state
.
screen
===
"
song
"
){
if
(
mouse
.
x
>
513
&&
mouse
.
y
>
603
){
if
(
mouse
.
x
>
641
&&
mouse
.
y
>
603
){
this
.
toSession
()
this
.
toSession
()
}
else
{
}
else
{
var
moveBy
=
this
.
songSelMouse
(
mouse
.
x
,
mouse
.
y
)
var
moveBy
=
this
.
songSelMouse
(
mouse
.
x
,
mouse
.
y
)
...
@@ -384,7 +384,7 @@ class SongSelect{
...
@@ -384,7 +384,7 @@ class SongSelect{
}
}
}
else
if
(
this
.
state
.
screen
===
"
difficulty
"
){
}
else
if
(
this
.
state
.
screen
===
"
difficulty
"
){
var
moveBy
=
this
.
diffSelMouse
(
mouse
.
x
,
mouse
.
y
)
var
moveBy
=
this
.
diffSelMouse
(
mouse
.
x
,
mouse
.
y
)
if
(
mouse
.
x
<
55
||
mouse
.
x
>
967
||
mouse
.
y
<
40
||
mouse
.
y
>
540
){
if
(
mouse
.
x
<
183
||
mouse
.
x
>
1095
||
mouse
.
y
<
40
||
mouse
.
y
>
540
){
this
.
toSongSelect
()
this
.
toSongSelect
()
}
else
if
(
moveBy
===
0
){
}
else
if
(
moveBy
===
0
){
this
.
selectedDiff
=
0
this
.
selectedDiff
=
0
...
@@ -406,7 +406,7 @@ class SongSelect{
...
@@ -406,7 +406,7 @@ class SongSelect{
var
mouse
=
this
.
mouseOffset
(
event
.
offsetX
,
event
.
offsetY
)
var
mouse
=
this
.
mouseOffset
(
event
.
offsetX
,
event
.
offsetY
)
var
moveTo
=
null
var
moveTo
=
null
if
(
this
.
state
.
screen
===
"
song
"
){
if
(
this
.
state
.
screen
===
"
song
"
){
if
(
mouse
.
x
>
513
&&
mouse
.
y
>
603
){
if
(
mouse
.
x
>
641
&&
mouse
.
y
>
603
){
moveTo
=
"
session
"
moveTo
=
"
session
"
}
else
{
}
else
{
var
moveTo
=
this
.
songSelMouse
(
mouse
.
x
,
mouse
.
y
)
var
moveTo
=
this
.
songSelMouse
(
mouse
.
x
,
mouse
.
y
)
...
@@ -426,7 +426,7 @@ class SongSelect{
...
@@ -426,7 +426,7 @@ class SongSelect{
}
}
mouseOffset
(
offsetX
,
offsetY
){
mouseOffset
(
offsetX
,
offsetY
){
return
{
return
{
x
:
(
offsetX
*
this
.
pixelRatio
-
this
.
winW
/
2
)
/
this
.
ratio
+
1
024
/
2
,
x
:
(
offsetX
*
this
.
pixelRatio
-
this
.
winW
/
2
)
/
this
.
ratio
+
1
280
/
2
,
y
:
(
offsetY
*
this
.
pixelRatio
-
this
.
winH
/
2
)
/
this
.
ratio
+
720
/
2
y
:
(
offsetY
*
this
.
pixelRatio
-
this
.
winH
/
2
)
/
this
.
ratio
+
720
/
2
}
}
}
}
...
@@ -445,7 +445,7 @@ class SongSelect{
...
@@ -445,7 +445,7 @@ class SongSelect{
songSelMouse
(
x
,
y
){
songSelMouse
(
x
,
y
){
if
(
this
.
state
.
locked
===
0
&&
this
.
songAsset
.
marginTop
<=
y
&&
y
<=
this
.
songAsset
.
marginTop
+
this
.
songAsset
.
height
){
if
(
this
.
state
.
locked
===
0
&&
this
.
songAsset
.
marginTop
<=
y
&&
y
<=
this
.
songAsset
.
marginTop
+
this
.
songAsset
.
height
){
x
-=
1
024
/
2
x
-=
1
280
/
2
var
dir
=
x
>
0
?
1
:
-
1
var
dir
=
x
>
0
?
1
:
-
1
x
=
Math
.
abs
(
x
)
x
=
Math
.
abs
(
x
)
var
selectedWidth
=
this
.
songAsset
.
selectedWidth
var
selectedWidth
=
this
.
songAsset
.
selectedWidth
...
@@ -463,10 +463,10 @@ class SongSelect{
...
@@ -463,10 +463,10 @@ class SongSelect{
}
}
diffSelMouse
(
x
,
y
){
diffSelMouse
(
x
,
y
){
if
(
this
.
state
.
locked
===
0
){
if
(
this
.
state
.
locked
===
0
){
if
(
95
<
x
&&
x
<
239
&&
118
<
y
&&
y
<
422
){
if
(
223
<
x
&&
x
<
367
&&
118
<
y
&&
y
<
422
){
return
Math
.
floor
((
x
-
95
)
/
((
239
-
95
)
/
2
))
return
Math
.
floor
((
x
-
223
)
/
((
367
-
223
)
/
2
))
}
else
if
(
422
<
x
&&
x
<
922
&&
95
<
y
&&
y
<
524
){
}
else
if
(
550
<
x
&&
x
<
1050
&&
95
<
y
&&
y
<
524
){
var
moveBy
=
Math
.
floor
((
x
-
422
)
/
((
922
-
422
)
/
5
))
+
this
.
diffOptions
.
length
var
moveBy
=
Math
.
floor
((
x
-
550
)
/
((
1050
-
550
)
/
5
))
+
this
.
diffOptions
.
length
var
currentSong
=
this
.
songs
[
this
.
selectedSong
]
var
currentSong
=
this
.
songs
[
this
.
selectedSong
]
if
(
this
.
state
.
ura
&&
moveBy
===
this
.
diffOptions
+
3
||
currentSong
.
stars
[
moveBy
-
this
.
diffOptions
.
length
]){
if
(
this
.
state
.
ura
&&
moveBy
===
this
.
diffOptions
+
3
||
currentSong
.
stars
[
moveBy
-
this
.
diffOptions
.
length
]){
return
moveBy
return
moveBy
...
@@ -740,17 +740,20 @@ class SongSelect{
...
@@ -740,17 +740,20 @@ class SongSelect{
h
:
38
,
h
:
38
,
id
:
id
id
:
id
},
ctx
=>
{
},
ctx
=>
{
var
text
=
this
.
sessionText
[
id
]
this
.
draw
.
layeredText
({
ctx
.
font
=
"
28px
"
+
this
.
font
ctx
:
ctx
,
ctx
.
textAlign
=
"
center
"
text
:
this
.
sessionText
[
id
],
ctx
.
textBaseline
=
"
middle
"
fontSize
:
28
,
ctx
.
strokeStyle
=
"
#000
"
fontFamily
:
this
.
font
,
ctx
.
lineWidth
=
8
x
:
w
/
2
,
ctx
.
lineJoin
=
"
round
"
y
:
38
/
2
,
ctx
.
miterLimit
=
1
width
:
w
-
30
,
ctx
.
strokeText
(
text
,
w
/
2
,
38
/
2
)
align
:
"
center
"
,
ctx
.
fillStyle
=
"
#fff
"
baseline
:
"
middle
"
ctx
.
fillText
(
text
,
w
/
2
,
38
/
2
)
},
[
{
outline
:
"
#000
"
,
letterBorder
:
8
},
{
fill
:
"
#fff
"
}
])
})
})
}
}
...
...
public/src/js/view.js
View file @
3a92a9c9
...
@@ -256,8 +256,9 @@
...
@@ -256,8 +256,9 @@
fontSize
:
15
,
fontSize
:
15
,
fontFamily
:
this
.
font
,
fontFamily
:
this
.
font
,
align
:
"
center
"
,
align
:
"
center
"
,
baseline
:
"
middle
"
,
x
:
_x
+
_w
/
2
,
x
:
_x
+
_w
/
2
,
y
:
_y
+
3
,
y
:
_y
+
_h
/
2
,
width
:
122
width
:
122
},
[
},
[
{
fill
:
"
#fff
"
}
{
fill
:
"
#fff
"
}
...
@@ -1247,7 +1248,7 @@
...
@@ -1247,7 +1248,7 @@
var
letterSpacing
=
fontSize
*
0.67
var
letterSpacing
=
fontSize
*
0.67
var
glyphW
=
50
var
glyphW
=
50
var
glyphH
=
64
var
glyphH
=
64
var
textX
=
11
var
textX
=
5
var
textY
=
5
var
textY
=
5
var
letterBorder
=
fontSize
*
0.15
var
letterBorder
=
fontSize
*
0.15
...
...
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