mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 14:37:04 +00:00
As part of the ongoing effort to remove the C-preprocessor (CPP) from the new Lisette compiler pipeline, this commit refactors CGContextCanvas.j to use native JavaScript and HTML5 Canvas APIs directly. Key changes: - Removed all `#define` macros that wrapped standard Canvas API calls (e.g., `_CGContextMoveToPointCanvas`). Direct method invocations are now used, eliminating the preprocessor pass and simplifying AST generation. - Removed the `CPJavaScriptCanvasTransformFeature` runtime check and its complex mathematical fallbacks (`scale_rotate`, `rotate_scale`, `eigen`). Modern target environments universally support native canvas transformations. - Removed obsolete vendor-prefixed line dash properties (`webkitLineDash`, `mozDash`) in favor of the standard `setLineDash`. - Replaced `var` with `const`/`let` for proper block scoping and immutability. - Replaced the `ROUND` macro with standard `Math.round`. These changes strip away 2008-era browser compatibility hacks and micro-optimizations, resulting in cleaner, more maintainable, and strictly browser-targeted code.