feat: Increase rendering resolution for Flutter and GLSL renderers to enhance visual clarity
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -198,17 +198,16 @@ class SixelRenderer extends CliRendererBackend<String> {
|
||||
_outputHeight = math.max(1, (_outputWidth / _targetAspectRatio).floor());
|
||||
}
|
||||
|
||||
// Horizontal: cell-width estimates vary by terminal/font and cause right-shift
|
||||
// clipping, so keep the image at column 0.
|
||||
// Vertical: use a conservative row estimate and keep one spare row so the
|
||||
// terminal does not scroll the image upward when its actual cell height is
|
||||
// smaller than our approximation.
|
||||
// Horizontal: cell-width estimates vary by terminal/font and can cause
|
||||
// right-shift clipping, so keep the image anchored at column 0.
|
||||
// Vertical: keep one spare row to avoid scroll, but anchor to the bottom
|
||||
// of the viewport so we avoid obvious empty space under the image.
|
||||
final int imageRows = math.max(
|
||||
1,
|
||||
(_outputHeight / _defaultLineHeightPx).ceil() + _terminalRowSafetyMargin,
|
||||
);
|
||||
_offsetColumns = 0;
|
||||
_offsetRows = math.max(0, (terminalRows - imageRows) ~/ 2);
|
||||
_offsetRows = math.max(0, terminalRows - imageRows);
|
||||
|
||||
if (_offsetColumns != previousOffsetColumns ||
|
||||
_offsetRows != previousOffsetRows ||
|
||||
|
||||
@@ -24,8 +24,8 @@ class WolfFlutterRenderer extends BaseWolfRenderer {
|
||||
|
||||
class _WolfFlutterRendererState
|
||||
extends BaseWolfRendererState<WolfFlutterRenderer> {
|
||||
static const int _renderWidth = 320;
|
||||
static const int _renderHeight = 200;
|
||||
static const int _renderWidth = 640;
|
||||
static const int _renderHeight = 400;
|
||||
final SoftwareRenderer _renderer = SoftwareRenderer();
|
||||
|
||||
ui.Image? _renderedFrame;
|
||||
@@ -34,7 +34,8 @@ class _WolfFlutterRendererState
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Match the original Wolf3D software resolution for the pixel renderer.
|
||||
// Render at 2x canonical resolution so menu/UI edges stay crisp and avoid
|
||||
// bleed when the output is scaled to the host viewport.
|
||||
if (widget.engine.frameBuffer.width != _renderWidth ||
|
||||
widget.engine.frameBuffer.height != _renderHeight) {
|
||||
widget.engine.setFrameBuffer(_renderWidth, _renderHeight);
|
||||
|
||||
@@ -31,8 +31,8 @@ class WolfGlslRenderer extends BaseWolfRenderer {
|
||||
}
|
||||
|
||||
class _WolfGlslRendererState extends BaseWolfRendererState<WolfGlslRenderer> {
|
||||
static const int _renderWidth = 640;
|
||||
static const int _renderHeight = 400;
|
||||
static const int _renderWidth = 960;
|
||||
static const int _renderHeight = 600;
|
||||
|
||||
final SoftwareRenderer _renderer = SoftwareRenderer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user