我拥有许多 github 存储库,我通常每周添加项目。我正在使用 github 页面制作自己的网站,因为我只能在 Github 页面上托管静态网站,因此我将使用 Github API 来自动更新我网站上的新项目。但我也想为其添加预览/示例图像。
我知道有一个名为 Social Preview 的选项,我可以在其中添加要在社交媒体上显示的存储库图像。
虽然我可以从中获取我的所有回购信息,api.github.com但我无法获取我的社交媒体预览图像 URL。
我的 Flutter 应用程序中有一个图标(特定的后退图标)。它看起来更轻。由于某些原因,我想让它变得大胆/增加重量。
Container(
child: Icon(
Icons.arrow_back,
color: Color(0xffffffff),
),
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.fromLTRB(0, 10.0, 0, 0.0),
decoration: BoxDecoration(
color: Color(0xff03b673),
borderRadius: BorderRadius.all(Radius.circular(100.0)),
),
)
Run Code Online (Sandbox Code Playgroud)
找不到任何关于它的主题/文档。
我面临这个问题,我的randomPoints 数组元素被推送方法替换。
这是我的控制台的输出
我不知道为什么会发生这种情况,但如果我不使用randomPoint.add,它就不会替换并且工作正常。
randomPoint.add返回与没有它时返回的相同 Vector 对象。
var hw
var center
var randomPoints = []
var pointWidth = 20
var points = 300
centerCircleWidth = 300;
pointsOffset = 10
function setup(){
hw = createVector(600,500)
createCanvas(hw.x,hw.y)
center = createVector(hw.x/2,hw.y/2)
var randomPoint = createVector(0,0)
randomPoints.push(randomPoint)
randomPoint = p5.Vector.fromAngle(-radians(120), random(centerCircleWidth/2-pointWidth,centerCircleWidth/2-pointsOffset))
randomPoints.push(randomPoint)
console.log(randomPoint)
randomPoint = randomPoint.add(p5.Vector.fromAngle(radians(60), random(pointsOffset,2*pointsOffset)))
// this here replaces the last element of array by itself and add another element of same type.
randomPoints.push(randomPoint)
console.log(randomPoint)
console.log(randomPoints)
} …Run Code Online (Sandbox Code Playgroud)