Comments (4)
On Linux I had issues making the color atlas texture lookups work correctly. It seems like the x, y coordinates end up picking values from adjacent cells and so the colors are wrong.
What I did to fix it (hopefully) is to make the color atlas texture "cells" bigger than 1x1 so even if the x,y coordinates are slightly off, the right color is chosen. I'm sure there's some reason for this madness, but I'm a WebGL noob, and debugging WebGL is hard.
This seems to work for me on Linux and MacOS. Maybe it will work for you as well?
render/highlight-attributes.ts
export const generateColorLookupAtlas = () => {
const max = Math.max(...highlights.keys(instances.current))
- canvas.width = max + 1
- canvas.height = 3
+ const texelSize = 2
+ canvas.width = (max + 1) * texelSize
+ canvas.height = 3 * texelSize
const defaultColors = getCurrentDefaultColors()
ui.imageSmoothingEnabled = false
highlights.forEach(instances.current, (hlgrp, id) => {
const defbg = hlgrp.reverse
? defaultColors.foreground
: defaultColors.background
ui.fillStyle = hlgrp.background || defbg
- ui.fillRect(id, 0, 1, 1)
+ ui.fillRect(id * texelSize, 0, texelSize, texelSize)
const deffg = hlgrp.reverse
? defaultColors.background
: defaultColors.foreground
ui.fillStyle = hlgrp.foreground || deffg
- ui.fillRect(id, 1, 1, 1)
+ ui.fillRect(id * texelSize, 1 * texelSize, texelSize, texelSize)
if (!hlgrp.underline) return
const color = hlgrp.special || defaultColors.special
ui.fillStyle = color
- ui.fillRect(id, 2, 1, 1)
+ ui.fillRect(id * texelSize, 2 * texelSize, texelSize, texelSize)
})
return canvas
}
render/webgl-text-bg.ts
- vec2 colorPosition = vec2(${v.hlid} + 0.0001, ${v.hlidType} + 0.0001) / ${v.colorAtlasReso
lution};
+ float texelSize = 2.0;
+ float color_x = ${v.hlid} * texelSize + 1.0;
+ float color_y = ${v.hlidType} * texelSize + 1.0;
+
+ vec2 colorPosition = vec2(color_x, color_y) / ${v.colorAtlasResolution};
render/webgl-text-fg.ts
- vec2 colorPosition = vec2(${v.hlid} + 0.0001, 1.0001) / ${v.colorAtlasResolution};
+ float texelSize = 2.0;
+ float color_x = ${v.hlid} * texelSize + 1.0;
+ float color_y = 1.0 * texelSize + 1.0;
+
+ vec2 colorPosition = vec2(color_x, color_y) / ${v.colorAtlasResolution};
By the way, great work on the project! I think using the builtin LSP support is a great idea. It's nice to see that the neovim devs considered both terminal and graphical UIs for the LSP support.
Apologies for my messy experimental code - never expected someone else to pick it up. There is a lot of rubbish that can be disposed of π
If you have any questions about anything let me know.
from uivonim.
Note: I don't see any of this on macOS, so this looks to be a low-level (electron or webGL) issue.
from uivonim.
Great, that works @Breja! Thank you so much! I've pushed the change.
Apologies for my messy experimental code - never expected someone else to pick it up. There is a lot of rubbish that can be disposed of π
No worries! I'm learning a good bit working on it, and it's proving to be a cool project to work on ;) Thanks for starting Veonim in the first place!
If you have any questions about anything let me know.
Will do, thank you! One thing I have wondered about is why you archived the original project? If you don't wish to share that, no worries, I'm just curious.
from uivonim.
Will do, thank you! One thing I have wondered about is why you archived the original project? If you don't wish to share that, no worries, I'm just curious.
I burned out while working on the project, and did not have the energy to continue. I suppose I could have asked for maintainers to take over, but I didn't think anyone would be interested.
from uivonim.
Related Issues (20)
- Key repeat not working on MacOS HOT 6
- Complex script like devanagari support HOT 4
- Text looks not well with guifont Iosevka HOT 3
- WSL: Uivonim commands not working HOT 4
- CJK character is not rendered correctly HOT 2
- Connection to server? HOT 2
- minimap HOT 1
- Sometimes rendering is gone HOT 2
- Impossible to type "<" HOT 3
- A "webview" or similar API HOT 2
- Builds from `master` donβt work on MacOS (Apple Silicon) HOT 5
- Cannot open uivonim from the command-line with parameters HOT 6
- how can i get uivonim colorsheme? HOT 2
- MacOS: A Javascript error occurred in the main process HOT 6
- Get error E12 when trying using `:edit` command. HOT 1
- Mouse does not work HOT 2
- Project Status HOT 3
- exception when startup HOT 1
- It's been a long time since a new version was released. HOT 2
- A JavaScript error occurred in the main process HOT 1
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 uivonim.