Content-Length: 770099 | pFad | http://github.com/NativeScript/NativeScript/commit/531b33d02b4844c0bbe7dda23b4bc4ff1ae67dea

1E fix background example (#3663) · NativeScript/NativeScript@531b33d · GitHub
Skip to content

Commit 531b33d

Browse files
author
Hristo Hristov
authored
fix background example (#3663)
1 parent c555b5b commit 531b33d

File tree

5 files changed

+34
-94
lines changed

5 files changed

+34
-94
lines changed

.vscode/launch.json

+8-37
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,41 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
{
5-
"name": "Sync on iOS",
6-
"type": "nativescript",
7-
"platform": "ios",
8-
"request": "launch",
9-
"appRoot": "${workspaceRoot}",
10-
"sourceMaps": true,
11-
"diagnosticLogging": false,
12-
"emulator": false,
13-
"rebuild": false,
14-
"syncAllFiles": false
15-
},
164
{
175
"name": "Launch on iOS",
186
"type": "nativescript",
19-
"platform": "ios",
207
"request": "launch",
8+
"platform": "ios",
219
"appRoot": "${workspaceRoot}",
2210
"sourceMaps": true,
23-
"diagnosticLogging": false,
24-
"emulator": false,
25-
"rebuild": true
11+
"watch": true
2612
},
2713
{
2814
"name": "Attach on iOS",
2915
"type": "nativescript",
30-
"platform": "ios",
3116
"request": "attach",
17+
"platform": "ios",
3218
"appRoot": "${workspaceRoot}",
3319
"sourceMaps": true,
34-
"diagnosticLogging": false,
35-
"emulator": false
36-
},
37-
{
38-
"name": "Sync on Android",
39-
"type": "nativescript",
40-
"platform": "android",
41-
"request": "launch",
42-
"appRoot": "${workspaceRoot}",
43-
"sourceMaps": true,
44-
"diagnosticLogging": false,
45-
"emulator": false,
46-
"rebuild": false
20+
"watch": false
4721
},
4822
{
4923
"name": "Launch on Android",
5024
"type": "nativescript",
51-
"platform": "android",
5225
"request": "launch",
26+
"platform": "android",
5327
"appRoot": "${workspaceRoot}",
5428
"sourceMaps": true,
55-
"diagnosticLogging": false,
56-
"emulator": false,
57-
"rebuild": true
29+
"watch": true
5830
},
5931
{
6032
"name": "Attach on Android",
6133
"type": "nativescript",
62-
"platform": "android",
6334
"request": "attach",
35+
"platform": "android",
6436
"appRoot": "${workspaceRoot}",
6537
"sourceMaps": true,
66-
"diagnosticLogging": false,
67-
"emulator": false
38+
"watch": false
6839
}
6940
]
7041
}

apps/.vscode/launch.json

+8-44
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,41 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
{
5-
"name": "Sync on iOS",
6-
"type": "nativescript",
7-
"platform": "ios",
8-
"request": "launch",
9-
"appRoot": "${workspaceRoot}",
10-
"sourceMaps": true,
11-
"diagnosticLogging": false,
12-
"emulator": false,
13-
"rebuild": false,
14-
"syncAllFiles": true,
15-
"stopOnEntry": true
16-
},
174
{
185
"name": "Launch on iOS",
196
"type": "nativescript",
20-
"platform": "ios",
217
"request": "launch",
8+
"platform": "ios",
229
"appRoot": "${workspaceRoot}",
2310
"sourceMaps": true,
24-
"diagnosticLogging": false,
25-
"emulator": false,
26-
"rebuild": true,
27-
"stopOnEntry": true
11+
"watch": true
2812
},
2913
{
3014
"name": "Attach on iOS",
3115
"type": "nativescript",
32-
"platform": "ios",
3316
"request": "attach",
17+
"platform": "ios",
3418
"appRoot": "${workspaceRoot}",
3519
"sourceMaps": true,
36-
"diagnosticLogging": false,
37-
"emulator": false,
38-
"stopOnEntry": true
39-
},
40-
{
41-
"name": "Sync on Android",
42-
"type": "nativescript",
43-
"platform": "android",
44-
"request": "launch",
45-
"appRoot": "${workspaceRoot}",
46-
"sourceMaps": true,
47-
"diagnosticLogging": false,
48-
"emulator": false,
49-
"rebuild": false,
50-
"syncAllFiles": true,
51-
"stopOnEntry": true
20+
"watch": false
5221
},
5322
{
5423
"name": "Launch on Android",
5524
"type": "nativescript",
56-
"platform": "android",
5725
"request": "launch",
26+
"platform": "android",
5827
"appRoot": "${workspaceRoot}",
5928
"sourceMaps": true,
60-
"diagnosticLogging": false,
61-
"emulator": false,
62-
"rebuild": true,
63-
"stopOnEntry": true
29+
"watch": true
6430
},
6531
{
6632
"name": "Attach on Android",
6733
"type": "nativescript",
68-
"platform": "android",
6934
"request": "attach",
35+
"platform": "android",
7036
"appRoot": "${workspaceRoot}",
7137
"sourceMaps": true,
72-
"diagnosticLogging": false,
73-
"emulator": false,
74-
"stopOnEntry": true
38+
"watch": false
7539
}
7640
]
7741
}

apps/.vscode/settings.json

-3
This file was deleted.

tns-core-modules/ui/core/view-common.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1997,8 +1997,8 @@ const fontProperty = new ShorthandProperty<Style, string>({
19971997
[fontFamilyProperty, unsetValue]
19981998
];
19991999
} else {
2000-
let font = parseFont(value);
2001-
let fontSize = parseFloat(font.fontSize);
2000+
const font = parseFont(value);
2001+
const fontSize = parseFloat(font.fontSize);
20022002

20032003
return [
20042004
[fontStyleProperty, font.fontStyle],

tns-core-modules/ui/styling/background.ios.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,22 @@ function drawNonUniformBorders(nativeView: NativeView, background: Background) {
193193
const lbi: Point = { x: nativeViewLayerBounds.left + left, y: nativeViewLayerBounds.bottom - bottom }; // left-bottom-inside
194194

195195
let hasNonUniformBorder: boolean;
196+
197+
// TODO: This is inefficient.
198+
// We need to know what caused the change and reuse as much as possible.
199+
if (nativeView.topBorderLayer) {
200+
nativeView.topBorderLayer.removeFromSuperlayer();
201+
}
202+
if (nativeView.rightBorderLayer) {
203+
nativeView.rightBorderLayer.removeFromSuperlayer();
204+
}
205+
if (nativeView.bottomBorderLayer) {
206+
nativeView.bottomBorderLayer.removeFromSuperlayer();
207+
}
208+
if (nativeView.leftBorderLayer) {
209+
nativeView.leftBorderLayer.removeFromSuperlayer();
210+
}
211+
196212
const borderTopColor = background.borderTopColor;
197213
if (top > 0 && borderTopColor && borderTopColor.ios) {
198214
const topBorderPath = CGPathCreateMutable();
@@ -209,8 +225,6 @@ function drawNonUniformBorders(nativeView: NativeView, background: Background) {
209225
layer.addSublayer(topBorderLayer);
210226
nativeView.topBorderLayer = topBorderLayer;
211227
hasNonUniformBorder = true;
212-
} else if (nativeView.topBorderLayer) {
213-
nativeView.topBorderLayer.removeFromSuperlayer();
214228
}
215229

216230
const borderRightColor = background.borderRightColor;
@@ -229,8 +243,6 @@ function drawNonUniformBorders(nativeView: NativeView, background: Background) {
229243
layer.addSublayer(rightBorderLayer);
230244
nativeView.rightBorderLayer = rightBorderLayer;
231245
hasNonUniformBorder = true;
232-
} else if (nativeView.rightBorderLayer) {
233-
nativeView.rightBorderLayer.removeFromSuperlayer();
234246
}
235247

236248
const borderBottomColor = background.borderBottomColor;
@@ -249,8 +261,6 @@ function drawNonUniformBorders(nativeView: NativeView, background: Background) {
249261
layer.addSublayer(bottomBorderLayer);
250262
nativeView.bottomBorderLayer = bottomBorderLayer;
251263
hasNonUniformBorder = true;
252-
} else if (nativeView.bottomBorderLayer) {
253-
nativeView.bottomBorderLayer.removeFromSuperlayer();
254264
}
255265

256266
const borderLeftColor = background.borderLeftColor;
@@ -269,8 +279,6 @@ function drawNonUniformBorders(nativeView: NativeView, background: Background) {
269279
layer.addSublayer(leftBorderLayer);
270280
nativeView.leftBorderLayer = leftBorderLayer;
271281
hasNonUniformBorder = true;
272-
} else if (nativeView.leftBorderLayer) {
273-
nativeView.leftBorderLayer.removeFromSuperlayer();
274282
}
275283

276284
nativeView.hasNonUniformBorder = hasNonUniformBorder;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/commit/531b33d02b4844c0bbe7dda23b4bc4ff1ae67dea

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy