(cfg DisplayConfig, action DesktopAction)
| 742 | } |
| 743 | |
| 744 | func desktopGeometryForAction(cfg DisplayConfig, action DesktopAction) workspacesdk.DesktopGeometry { |
| 745 | declaredWidth := cfg.Width |
| 746 | declaredHeight := cfg.Height |
| 747 | if action.ScaledWidth != nil && *action.ScaledWidth > 0 { |
| 748 | declaredWidth = *action.ScaledWidth |
| 749 | } |
| 750 | if action.ScaledHeight != nil && *action.ScaledHeight > 0 { |
| 751 | declaredHeight = *action.ScaledHeight |
| 752 | } |
| 753 | return workspacesdk.NewDesktopGeometryWithDeclared( |
| 754 | cfg.Width, |
| 755 | cfg.Height, |
| 756 | declaredWidth, |
| 757 | declaredHeight, |
| 758 | ) |
| 759 | } |
| 760 | |
| 761 | // missingFieldError is returned when a required field is absent from |
| 762 | // a DesktopAction. |
no test coverage detected