mirror of
https://github.com/akiyosi/goneovim.git
synced 2025-08-05 10:34:36 +02:00
Fixed a problem in which specifying columns would result in one column less than the specified size.
This commit is contained in:
parent
cbf44b113e
commit
832212fa7a
2 changed files with 4 additions and 3 deletions
|
@ -27,7 +27,7 @@ type ScrollBar struct {
|
|||
func newScrollBar() *ScrollBar {
|
||||
widget := widgets.NewQWidget(nil, 0)
|
||||
widget.SetContentsMargins(0, 0, 0, 0)
|
||||
widget.SetFixedWidth(10)
|
||||
widget.SetFixedWidth(editor.config.ScrollBar.Width)
|
||||
thumb := widgets.NewQWidget(widget, 0)
|
||||
thumb.SetFixedWidth(8)
|
||||
|
||||
|
|
|
@ -738,6 +738,7 @@ func (ws *Workspace) updateSize() (windowWidth, windowHeight, cols, rows int) {
|
|||
|
||||
geometry := e.window.Geometry()
|
||||
width := geometry.Width()
|
||||
|
||||
marginWidth := e.window.BorderSize()*4 + e.window.WindowGap()*2
|
||||
sideWidth := 0
|
||||
if e.side != nil {
|
||||
|
@ -783,7 +784,7 @@ func (ws *Workspace) updateSize() (windowWidth, windowHeight, cols, rows int) {
|
|||
screenWidth := width - scrollbarWidth - minimapWidth
|
||||
screenHeight := height - tablineHeight
|
||||
|
||||
rw := int(screenWidth) % int(ws.screen.font.cellwidth)
|
||||
rw := screenWidth - int(math.Ceil(float64(int(float64(screenWidth)/ws.screen.font.cellwidth))*ws.screen.font.cellwidth))
|
||||
rh := screenHeight % ws.screen.font.lineHeight
|
||||
screenWidth -= rw
|
||||
screenHeight -= rh
|
||||
|
@ -836,7 +837,7 @@ func (ws *Workspace) updateApplicationWindowSize(cols, rows int) {
|
|||
return
|
||||
}
|
||||
|
||||
appWinWidth := int(font.cellwidth * float64(cols))
|
||||
appWinWidth := int(math.Ceil(font.cellwidth * float64(cols)))
|
||||
appWinHeight := int(float64(font.lineHeight) * float64(rows))
|
||||
|
||||
marginWidth := e.window.BorderSize()*4 + e.window.WindowGap()*2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue