Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> W ie nie widać obrazka canvas
finito
post
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 16.12.2012

Ostrzeżenie: (0%)
-----


W ie (tryb dokumentu edge) po prostu jest białe tło cavnas - nie widać rysunku. A w trybach 9,10 debager mówi: "brak definicji path = new Path2D". Wiecie może co z tym fantem zrobić? Mam więcej kodu, ale tamten na potrzeby tego wątku na razie wywaliłem. Na firefoxie i chrome wszystko działa poprawnie.
  1. function pierscien()
  2. {
  3. var canvas = document.getElementById('tutorial');
  4. if (canvas.getContext)
  5. {
  6. ctx = canvas.getContext('2d');
  7.  
  8.  
  9. for (var i=0;i<5;i++)
  10. {
  11. var path = new Path2D();
  12.  
  13. var szer = ctx.width = "600";
  14. var wys = ctx.height = "500";
  15. var srodek_x = szer/4;
  16. var srodek_y = wys/4;
  17. var x = srodek_x;
  18. var y = 30+i*80;
  19. var radius = 20;
  20. var startAngle = 0;
  21. var endAngle = 2*(Math.PI);
  22. path.arc(x,y,radius,startAngle,endAngle);
  23. ctx.strokeStyle = "black";
  24. ctx.lineWidth=2;
  25. ctx.stroke(path);
  26.  
  27. }
  28. }
  29. }


Ten post edytował finito 15.07.2015, 15:18:25
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 10:01