Skip to content

Commit

Permalink
Revert "prototype(FastText): Add option to use TextBlock for simple t…
Browse files Browse the repository at this point in the history
…ext (#1256)" (#1939)

Reverts #1256. We need to update Text.windows.js to be in sync with the latest from react-native first.
  • Loading branch information
rozele authored Aug 14, 2018
1 parent 7fa57fc commit adb4539
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 733 deletions.
275 changes: 0 additions & 275 deletions Libraries/Text/Text.windows.js

This file was deleted.

1 change: 0 additions & 1 deletion ReactWindows/ReactNative.Net46/ReactNative.Net46.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
<Compile Include="Views\Scroll\ScrollView.cs" />
<Compile Include="Views\Slider\ReactSliderManager.cs" />
<Compile Include="Views\TextInput\PlaceholderAdorner.cs" />
<Compile Include="Views\Text\ReactSimpleTextViewManager.cs" />
<Compile Include="Views\Text\ReactTextCompoundView.cs" />
<Compile Include="Views\Text\ReactTextShadowNode.cs" />
<Compile Include="Views\Text\ReactTextViewManager.cs" />
Expand Down
1 change: 0 additions & 1 deletion ReactWindows/ReactNative.Net46/Shell/MainReactPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public IReadOnlyList<IViewManager> CreateViewManagers(
{
return new List<IViewManager>
{
new ReactSimpleTextViewManager(),
//new ReactFlipViewManager(),
new ReactImageManager(),
new ReactProgressBarViewManager(),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using ReactNative.UIManager;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

Expand All @@ -14,8 +13,7 @@ public int GetReactTagAtPoint(UIElement reactView, Point point)
{
var richTextBlock = reactView.As<TextBlock>();
var textPointer = richTextBlock.GetPositionFromPoint(point, true);
var parentView = RootViewHelper.GetReactViewHierarchy(textPointer.Parent).First();
return parentView.GetTag();
return textPointer.Parent.GetTag();
}
}
}
24 changes: 2 additions & 22 deletions ReactWindows/ReactNative.Net46/Views/Text/ReactTextShadowNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class ReactTextShadowNode : LayoutShadowNode

private string _fontFamily;

private string _text;

/// <summary>
/// Instantiates a <see cref="ReactTextShadowNode"/>.
/// </summary>
Expand All @@ -41,21 +39,6 @@ public ReactTextShadowNode()
MeasureText(this, node, width, widthMode, height, heightMode);
}

/// <summary>
/// Sets the text for the node.
/// </summary>
/// <param name="text">The text.</param>
[ReactProp("text")]
public void SetText(string text)
{
var nonNullText = text ?? "";
if (_text != nonNullText)
{
_text = nonNullText;
MarkUpdated();
}
}

/// <summary>
/// Sets the font size for the node.
/// </summary>
Expand Down Expand Up @@ -242,11 +225,8 @@ public void UpdateTextBlock(TextBlock textBlock)

private void UpdateTextBlockCore(TextBlock textBlock, bool measureOnly)
{
if (ChildCount == 0 && _text != null)
{
textBlock.Text = _text;
}

//textBlock.CharacterSpacing = _letterSpacing;
//textBlock.MaxLines = _numberOfLines;
textBlock.LineHeight = _lineHeight != 0 ? _lineHeight : double.NaN;
textBlock.TextAlignment = _textAlignment;
textBlock.FontSize = _fontSize ?? 15;
Expand Down
Loading

0 comments on commit adb4539

Please sign in to comment.