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

Fix typos #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Edit or create SVG paths in browser: https://yqnn.github.io/svg-path-editor/
- [Node.js](https://nodejs.org/) v18.13 or higher.

##### Dependencies
Run `npm install` to retrieve all the depencies of the project.
Run `npm install` to retrieve all the dependencies of the project.

##### Development server
Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
Expand All @@ -64,4 +64,4 @@ Run `docker build -t svg-path-editor . && docker run -p 4200:4200 svg-path-edito
## Special Thanks
Many thanks to our sponsors 🙇 !

[@riovir](https://github.com/riovir), [@miniBill](https://github.com/miniBill), [@GitHub](https://github.com/GitHub), [@alexandernst](https://github.com/alexandernst), [@Filimoa](https://github.com/Filimoa), [@agrogers](https://github.com/agrogers), [@MilesTails01](https://github.com/MilesTails01), [@robetus](https://github.com/robetus), [@adcar](https://github.com/adcar), [@getsentry](https://github.com/getsentry), [@simplicitywebdesign](https://github.com/simplicitywebdesign) 😎, [@PassPilot](https://github.com/PassPilot), [@zeroin](https://github.com/zeroin), [@jholmes-dev](https://github.com/jholmes-dev), [@sh-csg](https://github.com/sh-csg), [@MarcoRudin](https://github.com/MarcoRudin), [@Oddpod](https://github.com/Oddpod), [@roboflow](https://github.com/roboflow)
[@riovir](https://github.com/riovir), [@miniBill](https://github.com/miniBill), [@GitHub](https://github.com/GitHub), [@alexandernst](https://github.com/alexandernst), [@Filimoa](https://github.com/Filimoa), [@agrogers](https://github.com/agrogers), [@MilesTails01](https://github.com/MilesTails01), [@robetus](https://github.com/robetus), [@adcar](https://github.com/adcar), [@getsentry](https://github.com/getsentry), [@simplicitywebdesign](https://github.com/simplicitywebdesign) 😎, [@PassPilot](https://github.com/PassPilot), [@zeroin](https://github.com/zeroin), [@jholmes-dev](https://github.com/jholmes-dev), [@sh-csg](https://github.com/sh-csg), [@MarcoRudin](https://github.com/MarcoRudin), [@Oddpod](https://github.com/Oddpod), [@roboflow](https://github.com/roboflow)
50 changes: 25 additions & 25 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="left-column" cdk-scrollable>
<app-expandable panelTitle="Path" [panelInfo]="rawPath.length.toString()" [opened]="true">
<div class="row">
<div class="input-block" style="flex-grow:1" [class.has-error]="invalidSyntax">
<div class="input-block" style="flex-grow:1" [class.has-error]="invalidSyntax">
<label class="opaque">Path</label>
<textarea
[ngModel]="rawPath"
Expand All @@ -26,7 +26,7 @@
</div>
</div>
<div class="path-buttons">

<app-open (openPath)="openPath($event.path, $event.name)" style="margin-left: 6px;"></app-open>
<app-save [path]="rawPath" [(name)]="pathName"></app-save>

Expand All @@ -52,7 +52,7 @@
>
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</app-expandable>

<app-expandable panelTitle="Configuration" [opened]="true">
Expand All @@ -64,7 +64,7 @@
appFormatter
[numberValue]="cfg.viewPortX"
(numberValueChange)="updateViewPort($event, cfg.viewPortY, cfg.viewPortWidth, cfg.viewPortHeight)"
[disabled]="cfg.viewPortLocked"
[disabled]="cfg.viewPortLocked"
>
</div>
<div class="input-block" [ngClass]="{'disabled': cfg.viewPortLocked }">
Expand All @@ -74,7 +74,7 @@
appFormatter
[numberValue]="cfg.viewPortY"
(numberValueChange)="updateViewPort(cfg.viewPortX, $event, cfg.viewPortWidth, cfg.viewPortHeight)"
[disabled]="cfg.viewPortLocked"
[disabled]="cfg.viewPortLocked"
>
</div>
<div class="input-block" [ngClass]="{'disabled': cfg.viewPortLocked }">
Expand All @@ -85,7 +85,7 @@
formatterType="positive-float"
[numberValue]="cfg.viewPortWidth"
(numberValueChange)="updateViewPort(cfg.viewPortX, cfg.viewPortY, $event, null)"
[disabled]="cfg.viewPortLocked"
[disabled]="cfg.viewPortLocked"
>
</div>
<div class="input-block" [ngClass]="{'disabled': cfg.viewPortLocked }">
Expand All @@ -96,7 +96,7 @@
formatterType="positive-float"
[numberValue]="cfg.viewPortHeight"
(numberValueChange)="updateViewPort(cfg.viewPortX, cfg.viewPortY, null, $event)"
[disabled]="cfg.viewPortLocked"
[disabled]="cfg.viewPortLocked"
>
</div>

Expand Down Expand Up @@ -138,7 +138,7 @@
class="app-input"
appFormatter
formatterType="positive-integer"
[(numberValue)]="cfg.tickInterval"
[(numberValue)]="cfg.tickInterval"
[disabled]="!cfg.showTicks">
</div>
</div>
Expand Down Expand Up @@ -203,7 +203,7 @@
<input appFormatter suffix="°" [(numberValue)]="rotateAngle" class="app-input">
</div>
<button
mat-flat-button
mat-flat-button
(click)="rotate(rotateX, rotateY, rotateAngle)"
style="flex:1"
matTooltip="Rotate the full path by the given angle in degrees about the given point"
Expand All @@ -218,7 +218,7 @@
<input appFormatter formatterType="positive-integer" [(numberValue)]="roundValuesDecimals" class="app-input">
</div>
<button
mat-flat-button
mat-flat-button
(click)="roundValues(roundValuesDecimals)"
style="flex:1"
matTooltip="Round all values, input the number of decimals to keep"
Expand All @@ -228,27 +228,27 @@
</div>

<div class="row">
<button mat-flat-button
<button mat-flat-button
(click)="setRelative(true)"
matTooltip="Convert all commands to relative"
style="flex:1"
class="mat-flat-button"
>Convert to relative</button>
<button mat-flat-button
<button mat-flat-button
(click)="setRelative(false)"
matTooltip="Convert all commands to absolute"
style="flex:1"
class="mat-flat-button"
>Convert to absolute</button>
</div>
<div class="row">
<button mat-flat-button
<button mat-flat-button
(click)="reverse()"
matTooltip="Reverve path commands"
matTooltip="Reverse path commands"
style="flex:1"
class="mat-flat-button"
>Reverse</button>
<button mat-flat-button
<button mat-flat-button
(click)="optimize()"
matTooltip="Optimize the path by removing useless components, changing types and reordering"
style="flex:1"
Expand All @@ -259,7 +259,7 @@


<app-expandable panelTitle="Commands" [opened]="true">
<div *ngFor="let item of parsedPath.path; let j=index"
<div *ngFor="let item of parsedPath.path; let j=index"
(mouseenter)="hoveredItem=item"
(mouseleave)="hoveredItem=null"
[ngClass]="{
Expand Down Expand Up @@ -291,7 +291,7 @@
appKeyboardNavigable
keyboardNavigableIdPrefix="svg_command"
appFormatter
[numberValue]="value"
[numberValue]="value"
(numberValueChange)="setValue(item,i,$event);"
class="svg-value app-input"
id="svg_command_{{j}}_{{item.getType().toLowerCase()==='a' && i>4 ? i-1 : i}}"
Expand Down Expand Up @@ -404,7 +404,7 @@
matTooltip="Snap to Grid"
matTooltipPosition="left"
>
<mat-icon> {{ cfg.snapToGrid ? 'grid_on' : 'grid_off' }}</mat-icon>
<mat-icon> {{ cfg.snapToGrid ? 'grid_on' : 'grid_off' }}</mat-icon>
</button>
<button
mat-mini-fab
Expand All @@ -414,7 +414,7 @@
matTooltipPosition="left"
style="margin-top: 24px"
>
<mat-icon svgIcon="zoom_in"></mat-icon>
<mat-icon svgIcon="zoom_in"></mat-icon>
</button>
<button
mat-mini-fab
Expand All @@ -423,7 +423,7 @@
matTooltip="Zoom to Fit"
matTooltipPosition="left"
>
<mat-icon svgIcon="zoom_fit"></mat-icon>
<mat-icon svgIcon="zoom_fit"></mat-icon>
</button>
<button
mat-mini-fab
Expand All @@ -432,17 +432,17 @@
matTooltip="Zoom Out"
matTooltipPosition="left"
>
<mat-icon svgIcon="zoom_out"></mat-icon>
<mat-icon svgIcon="zoom_out"></mat-icon>
</button>
</div>

<svg
xmlns="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
app-canvas
app-canvas
[attr.viewBox]="cfg.viewPortX+' '+cfg.viewPortY+' '+cfg.viewPortWidth+' '+cfg.viewPortHeight"
[ngClass]="{preview:cfg.preview}"

[parsedPath]="parsedPath"
[targetPoints]="targetPoints"
[controlPoints]="controlPoints"
Expand Down Expand Up @@ -546,4 +546,4 @@
<mat-icon>delete</mat-icon> Delete
</button>
</ng-template>
</mat-menu>
</mat-menu>
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class AppComponent implements AfterViewInit {
$event.preventDefault();
}
} else if (!isLower && this.focusedItem && this.canConvert(this.focusedItem, key)) {
// Item convertion
// Item conversion
this.insert(key, this.focusedItem, true);
$event.preventDefault();
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/path-preview/path-preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class PathPreviewComponent implements OnInit {
}
}

patternScale(containterWidth: number, containerHeight: number): number {
return Math.max((this.width??0) / containterWidth, (this.height??0) / containerHeight);
patternScale(containerWidth: number, containerHeight: number): number {
return Math.max((this.width??0) / containerWidth, (this.height??0) / containerHeight);
}

}
4 changes: 2 additions & 2 deletions src/lib/optimize-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('optimizePath', () => {
expect(svg.asString()).toBe('M 4 4 l 1 1');
});

it('should handle pathologic pathes', () => {
it('should handle pathologic paths', () => {
const svg = new SvgPath('M 4 19 L 2 1 M 1 1');
optimizePath(svg, allOptimizations);
expect(svg.asString()).toBe('M 4 19 L 2 1');
Expand Down Expand Up @@ -111,4 +111,4 @@ describe('optimizePath', () => {
C 3 6 5 6 4 7 S 3 7 2 8 c -2 1 1 2 0 2 c -2 0 -1 1 -2 2
q -1 1 2 2 t 0 3 q 2 0 2 2 Z`));
});
});
});