diff --git a/examples/common/Component.ts b/examples/common/Component.ts index 51628b47..8b02d499 100644 --- a/examples/common/Component.ts +++ b/examples/common/Component.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import type { INode, INodeWritableProps, diff --git a/examples/common/ExampleSettings.ts b/examples/common/ExampleSettings.ts index 034bb272..409ae32d 100644 --- a/examples/common/ExampleSettings.ts +++ b/examples/common/ExampleSettings.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import type { Dimensions, RendererMain } from '@lightningjs/renderer'; export interface ExampleSettings { diff --git a/examples/common/LocalStorage.ts b/examples/common/LocalStorage.ts index d9ca71d2..514921c0 100644 --- a/examples/common/LocalStorage.ts +++ b/examples/common/LocalStorage.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Retreive state from local storage (if localStorage is available) // and set the state of the app accordingly. export function loadStorage(testName: string): Partial | null { diff --git a/examples/common/LoremIpsum.ts b/examples/common/LoremIpsum.ts index 084f6b52..6a564b98 100644 --- a/examples/common/LoremIpsum.ts +++ b/examples/common/LoremIpsum.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export function getLoremIpsum(numCharacters?: number) { if (numCharacters === undefined) { return loremIpsum; diff --git a/examples/common/PageContainer.ts b/examples/common/PageContainer.ts index b66b03f7..38c4fd22 100644 --- a/examples/common/PageContainer.ts +++ b/examples/common/PageContainer.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import type { INode, ITextNode, RendererMain } from '@lightningjs/renderer'; import { Component } from './Component.js'; import { loadStorage, saveStorage } from '../common/LocalStorage.js'; diff --git a/examples/common/paginateTestRows.ts b/examples/common/paginateTestRows.ts index 59af69d5..a715be07 100644 --- a/examples/common/paginateTestRows.ts +++ b/examples/common/paginateTestRows.ts @@ -1,3 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 Comcast Cable Communications Management, LLC. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import type { INode } from '@lightningjs/renderer'; import { PageContainer } from './PageContainer.js'; import { assertTruthy } from '@lightningjs/renderer/utils'; diff --git a/exports/utils.ts b/exports/utils.ts index 571f4000..87650fa2 100644 --- a/exports/utils.ts +++ b/exports/utils.ts @@ -37,5 +37,5 @@ * * @packageDocumentation */ -export { assertTruthy, mergeColorAlpha } from '../src/utils.js'; +export { assertTruthy, mergeColorAlpha, deg2Rad } from '../src/utils.js'; export { EventEmitter } from '../src/common/EventEmitter.js'; diff --git a/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.ts b/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.ts index 6ecbd227..fa2ad8ca 100644 --- a/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.ts +++ b/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.ts @@ -17,8 +17,6 @@ * limitations under the License. */ -// import { Colors } from '../../../Colors.js'; -// import type { Renderer } from '../../../Renderer.js'; import { intersectBound, type Bound, type Rect } from '../../../lib/utils.js'; import { TextRenderer, diff --git a/src/utils.ts b/src/utils.ts index baea1852..340cf3c8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -17,33 +17,6 @@ * limitations under the License. */ -export const boltProperties = [ - 'x', - 'y', - 'z', - 'w', - 'h', - 'color', - 'alpha', - 'parentId', - 'textureId', - 'rtt', - 'scale', - 'rotation', -]; - -export const pipelineEvents = { - created: 1, - updated: 2, - deleted: 4, - attached: 8, - detached: 16, - onscreen: 32, - offscreen: 64, - progress: 128, - finished: 256, -}; - export function createWebGLContext( canvas: HTMLCanvasElement | OffscreenCanvas, ): WebGLRenderingContext | null { @@ -200,3 +173,13 @@ export function mergeColorAlphaPremultiplied( export function hasOwn(obj: object, prop: string | number | symbol): boolean { return Object.prototype.hasOwnProperty.call(obj, prop); } + +/** + * Converts degrees to radians + * + * @param degrees + * @returns + */ +export function deg2Rad(degrees: number): number { + return (degrees * Math.PI) / 180; +}