fix for 8 bit colors in remmina

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2017-07-10 23:20:35 +03:00
parent 5ad25a5873
commit a9b36a4d3a
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ func (clr *Color) Write(c Conn) error {
var err error
order := clr.pf.order()
pixel := clr.cmIndex
if clr.pf.TrueColor == 1 {
if clr.pf.TrueColor != 0 {
pixel = uint32(clr.R) << clr.pf.RedShift
pixel |= uint32(clr.G) << clr.pf.GreenShift
pixel |= uint32(clr.B) << clr.pf.BlueShift
@ -96,7 +96,7 @@ func (clr *Color) Read(c Conn) error {
pixel = uint32(px)
}
if clr.pf.TrueColor == 1 {
if clr.pf.TrueColor != 0 {
clr.R = uint16((pixel >> clr.pf.RedShift) & uint32(clr.pf.RedMax))
clr.G = uint16((pixel >> clr.pf.GreenShift) & uint32(clr.pf.GreenMax))
clr.B = uint16((pixel >> clr.pf.BlueShift) & uint32(clr.pf.BlueMax))

View File

@ -330,7 +330,7 @@ func (msg *SetPixelFormat) Write(c Conn) error {
pf := c.PixelFormat()
// Invalidate the color map.
if pf.TrueColor != 1 {
if pf.TrueColor != 0 {
c.SetColorMap(ColorMap{})
}