mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
committed by
Nathan Walker
parent
527c70b465
commit
726ef9fd8f
@@ -1,5 +1,5 @@
|
|||||||
import { Color } from '../../color';
|
import { Color } from '../../color';
|
||||||
import { Length } from './style-properties';
|
import { Length, zeroLength } from './style-properties';
|
||||||
|
|
||||||
export interface CSSShadow {
|
export interface CSSShadow {
|
||||||
inset: boolean;
|
inset: boolean;
|
||||||
@@ -49,8 +49,11 @@ export function parseCSSShadow(value: string): CSSShadow {
|
|||||||
.filter((n) => n !== 'inset')
|
.filter((n) => n !== 'inset')
|
||||||
.filter((n) => n !== colorRaw)
|
.filter((n) => n !== colorRaw)
|
||||||
.map((val) => {
|
.map((val) => {
|
||||||
console.log(val);
|
try {
|
||||||
return Length.parse(val);
|
return Length.parse(val);
|
||||||
|
} catch (err) {
|
||||||
|
return zeroLength;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const [offsetX, offsetY, blurRadius, spreadRadius] = nums;
|
const [offsetX, offsetY, blurRadius, spreadRadius] = nums;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { Color } from '../../color';
|
|||||||
import { FormattedString } from './formatted-string';
|
import { FormattedString } from './formatted-string';
|
||||||
import { Span } from './span';
|
import { Span } from './span';
|
||||||
import { colorProperty, fontInternalProperty, Length, VerticalAlignment } from '../styling/style-properties';
|
import { colorProperty, fontInternalProperty, Length, VerticalAlignment } from '../styling/style-properties';
|
||||||
import { isString, isDefined, isNullOrUndefined } from '../../utils/types';
|
import { isString, isNullOrUndefined } from '../../utils/types';
|
||||||
import { iOSNativeHelper } from '../../utils';
|
import { iOSNativeHelper } from '../../utils';
|
||||||
import { Trace } from '../../trace';
|
import { Trace } from '../../trace';
|
||||||
|
|
||||||
@@ -153,8 +153,7 @@ export class TextBase extends TextBaseCommon {
|
|||||||
if (!(value instanceof Font) || !this.formattedText) {
|
if (!(value instanceof Font) || !this.formattedText) {
|
||||||
let nativeView = this.nativeTextViewProtected;
|
let nativeView = this.nativeTextViewProtected;
|
||||||
nativeView = nativeView instanceof UIButton ? nativeView.titleLabel : nativeView;
|
nativeView = nativeView instanceof UIButton ? nativeView.titleLabel : nativeView;
|
||||||
const font = value instanceof Font ? value.getUIFont(nativeView.font) : value;
|
nativeView.font = value instanceof Font ? value.getUIFont(nativeView.font) : value;
|
||||||
nativeView.font = font;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +189,7 @@ export class TextBase extends TextBaseCommon {
|
|||||||
this._setNativeText();
|
this._setNativeText();
|
||||||
}
|
}
|
||||||
|
|
||||||
[textShadowProperty.setNative](value: TextShadow) {
|
[textShadowProperty.setNative](value: CSSShadow) {
|
||||||
this._setShadow(value);
|
this._setShadow(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +377,7 @@ export class TextBase extends TextBaseCommon {
|
|||||||
// layer.shadowOffset = CGSizeMake(Length.toDevicePixels(value.offsetX), Length.toDevicePixels(value.offsetY));
|
// layer.shadowOffset = CGSizeMake(Length.toDevicePixels(value.offsetX), Length.toDevicePixels(value.offsetY));
|
||||||
layer.masksToBounds = false;
|
layer.masksToBounds = false;
|
||||||
|
|
||||||
// NOTE: generally should not need shouldRaterize
|
// NOTE: generally should not need shouldRasterize
|
||||||
// however for various detailed animation work which involves text-shadow applicable layers, we may want to give users the control of enabling this with text-shadow
|
// however for various detailed animation work which involves text-shadow applicable layers, we may want to give users the control of enabling this with text-shadow
|
||||||
// if (!(this.nativeTextViewProtected instanceof UITextView)) {
|
// if (!(this.nativeTextViewProtected instanceof UITextView)) {
|
||||||
// layer.shouldRasterize = true;
|
// layer.shouldRasterize = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user