appscms-tools-theme 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37e713267e3230b62492f9bf19510e934cbbfe91001e719f88feb7a2eedddf1c
4
- data.tar.gz: f311fc39c90497092d498d4b18cd80665b7d586d76df02d085967da3e0ad4177
3
+ metadata.gz: 453710446bc4e201a7b5e2df1de53122a01e9fa2aaa19050a271ec2169759646
4
+ data.tar.gz: dba6831293fca990e81216e8c653ff34e288b780dc280c8cf863803666134357
5
5
  SHA512:
6
- metadata.gz: c824552bfa12f3ae387f80cdbe94a13172d8d584eac73afec6e389d14c642722320e5d99e91858a21793e052a1daf4d09638302f15601006407450b7d7f34fff
7
- data.tar.gz: 111fd7714e929b6703219545567b447a7f860c92b66289a0789bf2aa45ed50681c3da71061f17c4cee8d4c510e742784d7d5121d9900ea4c7a8fb34afee8afe0
6
+ metadata.gz: '01628b3a082ffaf783bb7038fa49f973510388143d427ff730656a637cd3ae9c264c884eb260ab61ac17cdd91c40281311e1228327b20b292b7e38069feed044'
7
+ data.tar.gz: da1d00b2138166f94355700089c046889a6d25da6ad67f8b7b2d2425d808f1618fa25952747831692ddd49d47ec70793ef2c596663e7e0f496a6b35960496aea
data/assets/js/frame.js CHANGED
@@ -123,11 +123,13 @@ const drawImage = () => {
123
123
  if (item.type === 'text') {
124
124
  let myFont = new FontFace(item.font, `url(${item.fontPath})`)
125
125
  myFont.load().then(function (font) {
126
+ ctx.save()
126
127
  document.fonts.add(font)
127
128
  ctx.font = `${item.fontSize}px ${item.font}`
128
129
  if (item.shadowColor) {
129
130
  ctx.shadowColor = `${item.shadowColor}`
130
131
  }
132
+
131
133
  if (item.shadowOffsetX) {
132
134
  ctx.shadowOffsetX = 3
133
135
  }
@@ -137,7 +139,9 @@ const drawImage = () => {
137
139
  if (item.shadowBlur) {
138
140
  ctx.shadowBlur = 2
139
141
  }
140
- ctx.rotate(-Math.PI / 2)
142
+ if (item.rotate) {
143
+ ctx.rotate((item.rotate * Math.PI) / 180)
144
+ }
141
145
  ctx.textAlign = 'center'
142
146
  ctx.fillStyle = `${item.color}`
143
147
  ctx.fillText(
@@ -145,6 +149,7 @@ const drawImage = () => {
145
149
  item.x,
146
150
  item.y
147
151
  )
152
+ ctx.restore()
148
153
  })
149
154
  }
150
155
  if (item.type === 'rectangle') {
@@ -20,7 +20,7 @@
20
20
  "x": "100",
21
21
  "y": "100",
22
22
  "color": "red",
23
- "rotate": 40,
23
+ "rotate": 10,
24
24
  "fontFamily": "Calligraphy",
25
25
  "fontPath": "/assets/fonts/Calligraphy.ttf",
26
26
  "fontWeight": "bold",
@@ -33,8 +33,9 @@
33
33
  "perspective": "",
34
34
  "height": 300,
35
35
  "width": 300,
36
- "x": 100,
37
- "y": 200,
36
+ "rotate": 1,
37
+ "x": 0,
38
+ "y": 0,
38
39
  "id": "file-3"
39
40
  },
40
41
  {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms