Comments (18)
You can fund it through github sponsors or opencollective
from canvas.
Real device running android 10. My machine doesn't handle the emulator well.
from canvas.
Can you try wrapping the draw call in a setTimeout on android ? 🤔
from canvas.
I did, to no avail
from canvas.
Do I need to somehow install the native code for android? I ran ns plugin add @nativescript/canvas
to install, sufficient?
from canvas.
For iOS I sadly cannot test it because:
None of your spec sources contain a spec satisfying the dependency: CanvasNative (~> 0.9.19)
Do I need to compile the pod myself?
from canvas.
@Mwni fixed iOS there was plans to release a new pod but sadly I did not so the package had the wrong version update to 0.9.21
as for android I will fix also can you try webgl an lmk if it draws
let gl;
let canvas;
export function canvasReady(args) {
console.log('canvas ready');
canvas = args.object;
gl = canvas.getContext('webgl'); // 'webgl' || 'webgl2'
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
// Set the clear color to darkish green.
gl.clearColor(0.0, 0.5, 0.0, 1.0);
// Clear the context with the newly set color. This is
// the function call that actually does the drawing.
gl.clear(gl.COLOR_BUFFER_BIT);
}
from canvas.
The pod version 0.9.21
was not available, but 0.9.18
was, so the install worked, and the canvas did draw on iOS. Just as well did the WebGL context on android. So this could come down to some niche bug regarding my specific environment (Windows 7 Android emulator). triniwiz, thank you for looking into this. At this point I am perfectly able to continue developing my app.
from canvas.
Okay so the gl context drew fine on both platforms ? Then it would be on my end to fix for android also that package version is the npm package not a pod
from canvas.
Yes, gl worked fine. For 2d context on android, I have not tested it on an actual android device, I will let you know once I have, but I'm assuming it will work there. On a tangent, I did not find where I can specifically fund this development, would it be through the OpenJS foundation?
from canvas.
@triniwiz For android it working 2d but the canvas is broken layout it look like I draw a circle the result is cicle with broken it look like house tiles
from canvas.
@HakobiDev can you share a screenshot please
from canvas.
Re: rendering broken on Android. Here's the screenshot
And here's the code behind that view
onReady(event: any): void {
const canvas: Canvas = event.object;
const ctx = <CanvasRenderingContext2D> canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(75, 50);
ctx.lineTo(100, 75);
ctx.lineTo(100, 25);
ctx.scale(0.3, 0.5);
ctx.fill();
}
The white part is normally noise, but I have a non-attached canvas with a white background created as well and it somehow crosses over into the displayed canvas.
Sorry, if I should've opened a new issue, it's just that the last comment is describing this exact issue I think.
Oh and also, nativescript is version 8.0.2. Everything's as up to date as possible.
from canvas.
Can you try updating to the latest alpha
tag , also I added a new property to help with scaling ignorePixelScaling="true"
you can also try it
from canvas.
@triniwiz thanks! I will also check it out.
from canvas.
Just tried the latest alpha. The rendering is still broken. Noise is now replaced by black squares and it still tiles for some reason rather than displaying drawn image normally.
from canvas.
@OzymandiasTheGreat real device or emulator ?
from canvas.
Please try with the latest , reopen if the issue still persists
from canvas.
Related Issues (20)
- TypeError: Cannot read properties of null (reading 'getContextAttributes') HOT 9
- Trying to create image with no canvas on screen HOT 5
- Error in Android real device
- Strange visualization in iOS
- Points component not working HOT 1
- Line don't apply strokeWidth HOT 2
- Line does not work with paintStyle="fill" HOT 1
- Image don't work HOT 1
- Dom don't work in iOS HOT 4
- TwoPointConicalGradient strange behavior HOT 2
- CanvasRenderingContext2D.clip() does not seem to clip path HOT 1
- Android canvas becomes blank after few updates HOT 3
- Path2D.roundedRect crash on iOS 15.4 HOT 2
- XMLHttpRequest break NS default functionality HOT 1
- (ios): fill rule 'evenodd' has no effect HOT 4
- (ios): Small context does not render HOT 4
- (android): canvas content gets drawn out of bounds HOT 3
- canvas-babylon, no interaction possible and no file loading possible HOT 1
- [bug] Canvas content gets reset if app draws with delay
- NPE: Parameter specified as non-null is null: method HOT 2
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 canvas.