CodingTrain / CodingTrain/Suggestion-Box
windowResized() + line(pmouseX, pmouseY, mouseX, mouseY) problem
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 570
- Forks
- 85
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi There
Following this video along I bumped into a problem with no obvious solution:
https://www.youtube.com/watch?v=OIfEHD3KqCg&index=17&list=PLRqwX-V7Uu6bI1SlcCRfLH79HZrFAtBvX
Its a Q&A video that generated another Q!
If you resize the window the drawing made with line() disappears.
edit: testing again I realized that any drawing made like that would disappear with windowResized(). This is bad!
Here is the mini example:
```
function setup() {
canv = createCanvas(windowWidth, windowHeight);
canv.position(0, 0);
stroke(255, 0, 0);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function draw() {
if (mouseIsPressed) {
line(pmouseX, pmouseY, mouseX, mouseY);
}
}
```
I may open an issue in the p5 Github about it. But still, maybe I'm missing something. In the forum no one knew the solution to that.
best regards,
Gil
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
The issue provides a minimal p5.js sketch using setup(), windowResized(), resizeCanvas(), and draw(); first run it and resize the canvas to reproduce the disappearing drawing. The report does not name repository files or tests, so determine whether this belongs in p5.js rather than this suggestion repository. Done means establishing the correct project and documenting a confirmed resolution or routing decision.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100