- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 JavaFX 程序中,我绘制了一条黑色的单像素虚线。当我绘制黑色的单像素时在它上面的实线我仍然可以看到虚线穿过实线。无论我在 Canvas 上描画线条,还是使用设置了平滑的线条节点,都会发生这种情况为真。
这是为什么呢?有办法阻止吗?
附有示例程序和图像。
package sandbox2;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Line;
import javafx.stage.Stage;
public class Test extends Application
{
public static void main( String[] args )
{
launch( args );
}
@Override
public void start( Stage primaryStage ) throws Exception
{
primaryStage.setTitle( "Fx Playground" );
Group root = new Group();
Scene scene = new Scene( root, 350, 100 );
primaryStage.setScene( scene );
Line line1 = new Line( 50, 50, 300, 50 );
line1.setStroke( Color.BLACK );
line1.getStrokeDashArray().addAll( 5. );
line1.setSmooth( true );
Line line2 = new Line( 50, 50, 300, 50 );
line2.setStroke( Color.BLACK );
line2.setSmooth( true );
ObservableList<Node> nodes = root.getChildren();
nodes.add( line1 );
nodes.add( line2 );
primaryStage.show();
}
}
最佳答案
您应该将行构造函数更改为 new Line( 50.5, 50.5, 300, 50 )
我认为这可以解决问题。有关说明,请参阅:https://docs.oracle.com/javase/8/javafx/api/javafx/scene/shape/Shape.html
关于java - JavaFX 中的虚线穿过实线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45762673/
我在 UITextField 上遇到了这个奇怪的错误,有时有一条线(实际上更多的是透明条)穿过它。有谁知道怎么去掉吗? 这是图片 xib 文件的链接:http://db.tt/7l2Bq42 代码链接
这个问题在这里已经有了答案: ggplot2 and a Stacked Bar Chart with Negative Values (1 个回答) 7年前关闭。 friend 们, 如何在 x 轴
首先我是初学者,我想在向下滚动页面并穿过某个 div 时显示一个菜单栏(当我页面顶部的实际菜单栏不再可见时)这个网站有一个完美的例子来解决我的问题:http://lenssenmannenmode.n
我怎样才能阻止这种情况发生? 这是我联系我们表单的代码。我正在使用 Bootstrap 。当我展开文本区域时,它会穿过分区。我可以通过添加内联 CSS 在文本区域内尝试任何替代方法吗?
如何用matplotlib绘制这样的图? 最佳答案 检查 this example来自 this group 例如: from matplotlib import pyplot as plt impo
所以我一直在研究一款游戏,到目前为止最大的问题是我们无法让玩家与场上的任何物体发生碰撞。相反,他们直接穿过树。谁能告诉我为什么?这是我尝试用于碰撞检测的代码: for tree in treelist
我有这个代码: my link 1 my link 2 my link 3 当我对 应用填充时像这样: ul { list-style: none; margin: 3
我对 pinescript 很新,我被困在这一点上......我只想在 10 EMA 穿过 21 EMA 而 21 高于 50 EMA 和 50 EMA 高于 200 EMA 时绘制交叉。这是指示多头
我是一名优秀的程序员,十分优秀!