Przeglądaj źródła

页面编辑-修复缩略图 拖拽调整宽度后概率性崩溃问题

ZhouJieSheng 2 lat temu
rodzic
commit
bb7809be49

+ 2 - 2
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -61,7 +61,7 @@
                         <StackPanel
                             Name="StkpnlButtom"
                             Width="auto"
-                            MinWidth="50"
+                            MinWidth="10"
                             HorizontalAlignment="Center"
                             Background="Transparent">
                             <TextBlock
@@ -357,7 +357,7 @@
                         <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
                         <Setter Property="Margin" Value="0,10" />
                         <Setter Property="Visibility" Value="{Binding Visible}" />
-                        <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWayToSource,UpdateSourceTrigger=PropertyChanged}" />
+                        <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}" />
                         <Setter Property="HorizontalAlignment" Value="Center" />
                         <Setter Property="VerticalAlignment" Value="Center" />
                         <Setter Property="HorizontalContentAlignment" Value="Center" />

+ 4 - 0
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -826,6 +826,10 @@ namespace PDF_Office.Views.PageEdit
             if ((bool)TbnTwoLine.IsChecked)
             {
                 var itemwidth = (width - 80) / 2;
+                if(itemwidth<0)
+                {
+                    itemwidth = width / 4;
+                }
                 var itemHeight = 294 * itemwidth / 208.0;
                 viewModel.ChangeItemSize(new Size(itemwidth, itemHeight));
             }