Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore update scripts to b35cc5cca407e7082aa772aba6d8f684f3aa7da9 #19

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions client/declaration-merging/document-extended.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
declare function create<K extends keyof HTMLElementTagNameMap>(
tag: K,
attrs?: any,
attrs?: any
): HTMLElementTagNameMap[K];
/**
* Creates an element with the specified tag name.
Expand All @@ -23,7 +23,7 @@ declare function create<K extends keyof HTMLElementTagNameMap>(
*/
declare function create<K extends keyof HTMLElementDeprecatedTagNameMap>(
tag: string,
attrs?: any,
attrs?: any
): HTMLElementDeprecatedTagNameMap[K];
/**
* Creates an element with the specified tag name.
Expand Down Expand Up @@ -58,7 +58,7 @@ declare function create(html: string, attrs?: any): HTMLElement;
*/
declare function createDeep(
tag: string,
attrs?: any,
attrs?: any
): (
| HTMLElementDeprecatedTagNameMap[keyof HTMLElementDeprecatedTagNameMap]
| HTMLElementTagNameMap[keyof HTMLElementTagNameMap]
Expand All @@ -74,7 +74,7 @@ declare function createDeep(
* @returns {HTMLElementTagNameMap[K]}
*/
declare function find<K extends keyof HTMLElementTagNameMap>(
selector: K,
selector: K
): HTMLElementTagNameMap[K];
/**
* Using querySelector, returns the first element that matches the selector
Expand All @@ -85,7 +85,7 @@ declare function find<K extends keyof HTMLElementTagNameMap>(
* @returns {HTMLElementDeprecatedTagNameMap[K]}
*/
declare function find<K extends keyof HTMLElementDeprecatedTagNameMap>(
selector: string,
selector: string
): HTMLElementDeprecatedTagNameMap[K];
/**
* Using querySelector, returns the first element that matches the selector
Expand All @@ -105,7 +105,7 @@ declare function find(selector: string): HTMLElement;
* @returns {HTMLElementTagNameMap[K][]}
*/
declare function findAll<K extends keyof HTMLElementTagNameMap>(
selector: K,
selector: K
): HTMLElementTagNameMap[K][];

/**
Expand All @@ -117,7 +117,7 @@ declare function findAll<K extends keyof HTMLElementTagNameMap>(
* @returns {HTMLElementDeprecatedTagNameMap[K][]}
*/
declare function findAll<K extends keyof HTMLElementDeprecatedTagNameMap>(
selector: string,
selector: string
): HTMLElementDeprecatedTagNameMap[K][];

/**
Expand Down
6 changes: 3 additions & 3 deletions client/declaration-merging/pdfjslib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export interface PdfJsPage {
scale:
| number
| {
scale: number;
rotation: number;
},
scale: number;
rotation: number;
}
): PdfJsViewport;
getTextContent(): Promise<PdfJsTextContent>;
getAnnotations(): Promise<PdfJsAnnotation[]>;
Expand Down
37 changes: 37 additions & 0 deletions client/models/canvas/border.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Point2D } from '../../../shared/submodules/calculations/src/linear-algebra/point';
import { Polygon } from './polygon';

export class Border extends Polygon {
isIn(point: Point2D) {
return !super.isIn(point);
}

draw(ctx: CanvasRenderingContext2D) {
const region = new Path2D();

region.moveTo(
this.points[0][0] * ctx.canvas.width,
this.points[0][1] * ctx.canvas.height,
);

for (let i = 1; i < this.points.length; i++) {
region.lineTo(
this.points[i][0] * ctx.canvas.width,
this.points[i][1] * ctx.canvas.height,
);
}
region.closePath();

region.moveTo(0, 0);
region.lineTo(ctx.canvas.width, 0);
region.lineTo(ctx.canvas.width, ctx.canvas.height);
region.lineTo(0, ctx.canvas.height);
region.closePath();

// fill the area between the polygon and the canvas edges
if (this.$properties?.fill?.color) {
ctx.fillStyle = this.$properties.fill.color;
}
if (this.$properties?.fill) ctx.fill(region, 'evenodd');
}
}
Loading
Loading