Skip to content

Commit

Permalink
Fields should be double
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Leclerc committed Jun 18, 2024
1 parent 84e6567 commit 91b9ec4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/AzureMapsControl.Components/Layers/MediaLayerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class MediaLayerOptions : LayerOptions
/// <summary>
/// A number between -1 and 1 that increases or decreases the contrast of the overlay.
/// </summary>
public int? Contrast { get; set; }
public double? Contrast { get; set; }

/// <summary>
/// The duration in milliseconds of a fade transition when a new tile is added.
Expand All @@ -33,22 +33,22 @@ public abstract class MediaLayerOptions : LayerOptions
/// <summary>
/// A number between 0 and 1 that increases or decreases the maximum brightness of the overlay.
/// </summary>
public int? MaxBrightness { get; set; }
public double? MaxBrightness { get; set; }

/// <summary>
/// A number between 0 and 1 that increases or decreases the minimum brightness of the overlay.
/// </summary>
public int? MinBrightness { get; set; }
public double? MinBrightness { get; set; }

/// <summary>
/// A number between 0 and 1 that indicates the opacity at which the overlay will be drawn.
/// </summary>
public int? Opacity { get; set; }
public double? Opacity { get; set; }

/// <summary>
/// A number between -1 and 1 that increases or decreases the saturation of the overlay.
/// </summary>
public int? Saturation { get; set; }
public double? Saturation { get; set; }
}

internal abstract class MediaLayerOptionsJsonConverter<TOptions> : LayerOptionsJsonConverter<TOptions>
Expand All @@ -70,7 +70,7 @@ protected static void ReadMediaLayerOptionsProperty(string propertyName, Utf8Jso
switch (propertyName)
{
case "contrast":
value.Contrast = reader.TokenType == JsonTokenType.Null ? null : reader.GetInt32();
value.Contrast = reader.TokenType == JsonTokenType.Null ? null : reader.GetDouble();
break;

case "fadeDuration":
Expand All @@ -82,19 +82,19 @@ protected static void ReadMediaLayerOptionsProperty(string propertyName, Utf8Jso
break;

case "maxBrightness":
value.MaxBrightness = reader.TokenType == JsonTokenType.Null ? null : reader.GetInt32();
value.MaxBrightness = reader.TokenType == JsonTokenType.Null ? null : reader.GetDouble();
break;

case "minBrightness":
value.MinBrightness = reader.TokenType == JsonTokenType.Null ? null : reader.GetInt32();
value.MinBrightness = reader.TokenType == JsonTokenType.Null ? null : reader.GetDouble();
break;

case "opacity":
value.Opacity = reader.TokenType == JsonTokenType.Null ? null : reader.GetInt32();
value.Opacity = reader.TokenType == JsonTokenType.Null ? null : reader.GetDouble();
break;

case "saturation":
value.Saturation = reader.TokenType == JsonTokenType.Null ? null : reader.GetInt32();
value.Saturation = reader.TokenType == JsonTokenType.Null ? null : reader.GetDouble();
break;
}
}
Expand Down

0 comments on commit 91b9ec4

Please sign in to comment.