@@ -5,36 +5,34 @@ import {Layer} from './base'
5
5
import { dateTime } from '@utils/date-time'
6
6
7
7
export class DetailsLayer extends Layer implements DetailsSchema {
8
- calendar = new ImageLayer ( this . position . x , 0 , 180 , 180 )
9
- . setSize ( 48 , 48 )
8
+ calendar = new ImageLayer ( this . position . x , 0 , this . height , this . height )
9
+ . setSize ( this . height / 4 , this . height / 4 )
10
10
. setSrc ( 'icons/calendar.svg' )
11
11
12
- clock = new ImageLayer ( this . position . x , 0 , 180 , 180 )
13
- . setSize ( 48 , 48 )
12
+ clock = new ImageLayer ( this . position . x , 0 , this . height , this . height )
13
+ . setSize ( this . height / 4 , this . height / 4 )
14
14
. setSrc ( 'icons/clock.svg' )
15
15
16
- pin = new ImageLayer ( this . position . x , 0 , 1080 , 180 )
17
- . setSize ( 48 , 48 )
16
+ pin = new ImageLayer ( this . position . x , 0 , 1080 , this . height )
17
+ . setSize ( this . height / 4 , this . height / 4 )
18
18
. setSrc ( 'icons/pin.svg' )
19
19
20
- date = new WordLayer ( 0 , 0 , this . width - this . calendar . width , 180 )
21
- . setSize ( 48 )
20
+ date = new WordLayer ( 0 , 0 , this . width - this . calendar . width , this . height )
21
+ . setSize ( this . height / 4 )
22
22
. setWeight ( 'normal' )
23
23
. setColor ( '#f9f9f9' )
24
24
25
- time = new WordLayer ( 0 , 0 , this . width - this . clock . width , 180 )
26
- . setSize ( 48 )
25
+ time = new WordLayer ( 0 , 0 , this . width - this . clock . width , this . height )
26
+ . setSize ( this . height / 4 )
27
27
. setWeight ( 'normal' )
28
28
. setColor ( '#f9f9f9' )
29
29
30
- location = new WordLayer ( 0 , 0 , this . width - this . pin . width , 180 )
31
- . setSize ( 48 )
30
+ location = new WordLayer ( 0 , 0 , this . width - this . pin . width , this . height )
31
+ . setSize ( this . height / 4 )
32
32
. setWeight ( 'normal' )
33
33
. setColor ( '#f9f9f9' )
34
34
35
35
async render ( ) {
36
-
37
-
38
36
let y = this . height / 4 - 12
39
37
40
38
let x = 20
@@ -53,7 +51,7 @@ export class DetailsLayer extends Layer implements DetailsSchema {
53
51
54
52
async renderDate ( x : number , y : number ) {
55
53
this . context . clearRect ( 0 , 0 , this . width , this . height )
56
-
54
+
57
55
if ( ! this . date . isEmpty ) {
58
56
await this . calendar . render ( )
59
57
this . context . drawImage ( this . calendar , x , y )
0 commit comments