Comments (2)
@jerch
I did the same thing,And there are also scenarios of DPR changes.
xterm.js/src/browser/services/CoreBrowserService.ts
Lines 18 to 19 in c73793f
However, my scene is relatively simple without scaling, so CSS * DPR is sufficient.
reference:
xterm.js/src/browser/renderer/shared/TextureAtlas.ts
Lines 667 to 676 in c73793f
from xterm.js.
@Tyriar Whats the right way to scale a canvas to operate on real device pixels instead of css pixels? Should that be done on width/height attribute level of the canvas object?
For example - lets say we have a DPR of 2 at hand - where should that "doubled" pixel values go? Would this be sufficent (and the browser deals with the low level stuff on its own):
const canvasObj = ...
// apply real pixel values to canvas (doubled here)
canvasObj.width = cssWidth * DPR;
canvasObj.height = cssHeight * DPR;
// output is still within the logical css pixels
canvasObj.style.width = cssWidth;
canvasObj.style.height = cssHeight;
// later on during painting:
canvasObj.drawImage(...<metrics here now in real device pixels>...);
Would that already fix things? (Sorry if that question looks dumb to you, but I've never done this DPR correction myself, also I cannot really test it...)
from xterm.js.
Related Issues (20)
- xterm deletes content instead of wrapping HOT 4
- Terminals not accessible using nano, vim, etc. in Cloud Shell and likely elsewhere HOT 1
- ptyProcess.kill() is error
- Line break bug HOT 1
- Consider making the canvas selection further right to the overview ruler/scroll bar HOT 1
- Overlapping glyphs m+@ HOT 2
- Decorations outside the scrollable area are not being updated HOT 1
- Inconsistent term.onData Event Behavior Between iOS and Android in React Native WebView Terminal HOT 1
- Incorrect pasting the Greek letter ϕ (U+03D5) and φ (U+03C6) from xterm.js to another text-area HOT 2
- SyntaxError: Named export 'context' not found. HOT 11
- Run a command which runs for a long time will awlays make the browser crash HOT 11
- Sb
- Sa
- The website uses HTTP instead of HTTPS by default HOT 6
- When run into alternate, BaseY never get updated and can't scroll the view HOT 2
- Follow GTK/Qt color scheme for frame and background and text HOT 3
- Bring back ballistic scroll for mouse events HOT 1
- Unable to preventDefault inside passive event listener invocation.
- Poor performance on safari
- Every addon has incorrect module mappings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xterm.js.