Skip to content

Commit

Permalink
Prepare release 1.3 (#167)
Browse files Browse the repository at this point in the history
* Change version to 1.3

* Update Readme

* Add initializers

* Update Readme

* Fix TextMask pixel scaling

* Update Readme
  • Loading branch information
mgierlasinski authored Apr 26, 2021
1 parent ae4b06c commit 39efb6c
Show file tree
Hide file tree
Showing 16 changed files with 241 additions and 59 deletions.
Binary file added Assets/Images/clip_mode_exclude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/clip_mode_include.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/mask_collection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/mask_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/mask_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/mask_rectangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/mask_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/masks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions MagicGradients.Toolkit/Initializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace MagicGradients.Toolkit
{
public static class Initializer
{
public static void Init()
{

}
}
}
2 changes: 1 addition & 1 deletion MagicGradients/MagicGradients.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<Authors>Marcin Gierlasiński, Bohdan Benetskyi and Contributors</Authors>
<Product>Magic Gradients</Product>
<Description>Draw breathtaking backgrounds in your Xamarin.Forms application. It's a kind of magic. Powered by SkiaSharp.</Description>
Expand Down
6 changes: 3 additions & 3 deletions MagicGradients/Masks/TextMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public override void Clip(RenderContext context)
if (!IsActive)
return;

using var textPaint = GetTextPaint();
using var textPaint = GetTextPaint(context);
using var textPath = textPaint.GetTextPath(Text, 0, 0);

ClipPath(context, textPath);
}

private SKPaint GetTextPaint()
private SKPaint GetTextPaint(RenderContext context)
{
var isBold = (FontAttributes & FontAttributes.Bold) == FontAttributes.Bold;
var isItalic = (FontAttributes & FontAttributes.Italic) == FontAttributes.Italic;
Expand All @@ -68,7 +68,7 @@ private SKPaint GetTextPaint()

return new SKPaint
{
TextSize = (float)FontSize,
TextSize = (float)(FontSize * context.PixelScaling),
Typeface = SKTypeface.FromFamilyName(FontFamily, fontStyle),
IsAntialias = true
};
Expand Down
12 changes: 3 additions & 9 deletions Playground/Playground/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ public partial class App : Application
{
public App()
{
Device.SetFlags(new[]
{
"Shapes_Experimental",
"Expander_Experimental",
"Shell_UWP_Experimental"
});
Device.SetFlags(new[] { "Shell_UWP_Experimental" });

InitializeComponent();

MagicGradients.Toolkit.Initializer.Init();
Sharpnado.Shades.Initializer.Initialize(false);
Sharpnado.Tabs.Initializer.Initialize(false, false);

AppSetup.RegisterTypes();
AppSetup.RegisterViewModels();
AppSetup.Initialize();
AppSetup.ConfigureAndRun();

MainPage = new AppShell();
}
Expand Down
8 changes: 8 additions & 0 deletions Playground/Playground/AppSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public static class AppSetup
{
public static Container IoC { get; } = new Container();

public static void ConfigureAndRun()
{
RegisterTypes();
RegisterViewModels();
RegisterRoutes();
Initialize();
}

public static void RegisterTypes()
{
IoC.Register<IDatabaseProvider, DatabaseProvider>();
Expand Down
2 changes: 0 additions & 2 deletions Playground/Playground/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public partial class AppShell : Shell
public AppShell()
{
InitializeComponent();

AppSetup.RegisterRoutes();
}
}
}
2 changes: 1 addition & 1 deletion Playground/Playground/Features/Masks/MasksPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<magic:GradientView StyleClass="textExclude" HorizontalOptions="Fill" Grid.Column="1">
<magic:GradientView.Mask>
<magic:MaskCollection>
<magic:TextMask Text="Gradients" FontSize="50" ClipMode="Exclude" />
<magic:TextMask Text="Gradients" FontSize="30" ClipMode="Exclude" />
<magic:RectangleMask Corners="0,0,50,0" />
</magic:MaskCollection>
</magic:GradientView.Mask>
Expand Down
Loading

0 comments on commit 39efb6c

Please sign in to comment.