mirror of
https://github.com/smittix/intercept.git
synced 2026-07-17 05:48:11 -07:00
Fix oval polar plot — remove height:100% that overrode aspect-ratio
Setting both width:100% and height:100% made CSS ignore aspect-ratio, stretching the drawing buffer non-uniformly into the tall container. Fixed by keeping only width:100% + max-height:100% so aspect-ratio:1/1 clamps the height and the element stays square. Draw functions now use canvas.offsetWidth for the square buffer size. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -753,8 +753,6 @@ body {
|
|||||||
#polarPlot {
|
#polarPlot {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
aspect-ratio: 1 / 1;
|
aspect-ratio: 1 / 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2289,8 +2289,7 @@
|
|||||||
function drawPolarPlot(pass) {
|
function drawPolarPlot(pass) {
|
||||||
const canvas = document.getElementById('polarPlot');
|
const canvas = document.getElementById('polarPlot');
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
const rect = canvas.getBoundingClientRect();
|
const size = canvas.offsetWidth || 300;
|
||||||
const size = Math.round(Math.min(rect.width, rect.height || rect.width));
|
|
||||||
canvas.width = size;
|
canvas.width = size;
|
||||||
canvas.height = size;
|
canvas.height = size;
|
||||||
|
|
||||||
@@ -2518,8 +2517,7 @@
|
|||||||
function drawPolarPlotWithPosition(az, el, color) {
|
function drawPolarPlotWithPosition(az, el, color) {
|
||||||
const canvas = document.getElementById('polarPlot');
|
const canvas = document.getElementById('polarPlot');
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
const rect = canvas.getBoundingClientRect();
|
const size = canvas.offsetWidth || 300;
|
||||||
const size = Math.round(Math.min(rect.width, rect.height || rect.width));
|
|
||||||
canvas.width = size;
|
canvas.width = size;
|
||||||
canvas.height = size;
|
canvas.height = size;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user