Comments (4)
Hey,
I guess it's to do with the all the sizing you're doing?
this.signaturePad.set('canvasWidth', (this.content.contentWidth / 2) - 5);
this.signaturePad.set('canvasHeight', (this.content.contentHeight / 2) * 0.84);
//
this.signaturePad.resizeCanvas()
this.content.resize();
Check out the demo app, which has a responsive pad: https://github.com/lathonez/angular2-signaturepad-demo/blob/master/src/app/app.component.ts#L30-L44
Let us know if that doesn't solve it, or if you're looking to achieve something outside of what the demo app is doing.
Stephen
from angular2-signaturepad.
Unsure what the problem is supposed to be.
If something is not working on init, but is working after resize, and you have bound it to window.resize explicitly, there is possibly an issue with the initialisation code?
Google Ionic Nav Lifecycle events and apply your initialisation code to the appropriate event, as opposed to ngAfterViewInit.
from angular2-signaturepad.
Hey,
thank you for your advice, mouse position is coordinates. :-) But now I have a problem with height on first open page, how can you see on images.
I have this html, sass and code:
<ion-content class="backColor" (window:resize)="beResponsive()">
<div class="sig-container" #sigContainer1>
<div fxLayout="row">
<signature-field></signature-field>
</div>
</div>
<div class="sig-button" fxLayout="row">
<button ion-button full color="danger" (click)="clearPad()">{{'SIGNATURE.CANCEL' | translate}}</button>
<button ion-button full color="secondary" (click)="savePad()">{{'SIGNATURE.SAVE' | translate}}</button>
</div>
</ion-content>
.sig-container {
height: 80%;
canvas {
background: white;
}
}
.sig-button{
display: flex;
height: 20%;
button{
margin: auto 4px;
}
}
@ViewChildren(SignatureFieldComponent) public sigs: QueryList<SignatureFieldComponent>;
@ViewChildren('sigContainer1') public sigContainer1: QueryList<ElementRef>;
public ngAfterViewInit() {
this.beResponsive();
}
public beResponsive() {
this.size(this.sigContainer1.first, this.sigs.first);
}
public size(container: ElementRef, sig: SignatureFieldComponent){
sig.signaturePad.set('canvasWidth', container.nativeElement.clientWidth);
sig.signaturePad.set('canvasHeight', container.nativeElement.clientHeight);
}
Thank you for your help
John
from angular2-signaturepad.
You have right, this is right event: ionViewDidEnter.
Thank you for your advice.
from angular2-signaturepad.
Related Issues (20)
- Memory Leaks HOT 1
- Ivy/Angular9 Compatibility (Symbol is not exported)
- OnResize window canvas height increase constantly independent of screen size HOT 4
- 'node_modules/angular2-signaturepad/index.ts' not found
- iOS/safari canvas memory leak
- `Cannot read property 'offsetWidth' of undefined` on resizeCanvas HOT 2
- Upgrade to angular 8+ HOT 5
- Signature with Text HOT 1
- [Ionic]: Signature Pad focus issue for iOS devices (issue A11y) HOT 1
- [ERROR] Build with angular/[email protected] HOT 2
- is there a regression of Fix #94 ? HOT 1
- Compilation issue, gives module has no exported member 'SignaturePadModule' HOT 3
- ERROR in src/app/components/modals/modals.module.ts(15,10): error TS2305: Module '"../../../../node_modules/angular2-signaturepad/angular2-signaturepad"' has no exported member 'SignaturePadModule'. HOT 3
- this.sigaturePad.set('canvasWidth', value) giving error HOT 4
- Signature pad issue on iOS 12 Device HOT 1
- Update to Angular 13 HOT 14
- Outdated peer dependency warnings
- Voiceover in IOS completely ignores the signature pad.
- Error: Module not found: Error: Can't resolve 'signature_pad' (v4.0.1 with Angular v13 Error) HOT 3
- Getting correct mouse offset on scale
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-signaturepad.