fix(geom7): SVG снова растягивается на ширину контейнера (responsive)

Откатил неверный фикс: добавление width="W" height="H" атрибутов
заставило SVG рендериться в intrinsic-размере 180×160 px вместо
заполнения родительского контейнера. Из-за этого рисунки выглядели
маленькими.

Теперь svgBox использует правильную responsive-стратегию:
- viewBox="0 0 W H" — определяет систему координат
- preserveAspectRatio="xMidYMid meet" — сохраняет пропорции
- style="width:100%; max-width:Wpx; height:auto" — растягивает
  до ширины контейнера, но не больше intrinsic W; height auto
  держит правильное соотношение сторон через viewBox

Cache-bust ?v=5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-05-29 08:36:13 +03:00
parent 41f6561357
commit cf88cb88dc
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ G.svgBox = function(w, h, opts){
+'</pattern></defs>'
+'<rect width="'+w+'" height="'+h+'" fill="url(#g7-grid-'+(opts.id||'def')+')"/>';
}
return { open:'<svg viewBox="0 0 '+w+' '+h+'" width="'+w+'" height="'+h+'" style="max-width:'+(opts.maxWidth||'100%')+';height:auto;display:block;margin:'+(opts.margin||'0 auto')+';background:'+bg+';border-radius:10px;border:1px solid #e2e8f0">'+gridSvg, close:'</svg>' };
return { open:'<svg viewBox="0 0 '+w+' '+h+'" preserveAspectRatio="xMidYMid meet" style="width:100%;max-width:'+(opts.maxWidth||(w+'px'))+';height:auto;display:block;margin:'+(opts.margin||'0 auto')+';background:'+bg+';border-radius:10px;border:1px solid #e2e8f0">'+gridSvg, close:'</svg>' };
};
/* === Точка === */